规避一些危险项目吧

This commit is contained in:
sin365 2025-10-08 01:06:35 +08:00
parent 8879df5e17
commit f492c29146
12 changed files with 72 additions and 60 deletions

View File

@ -1,4 +1,5 @@
using System;
#if !UNITY_SWITCH
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
@ -172,3 +173,4 @@ namespace AxiReplay
}
}
#endif

View File

@ -1,4 +1,5 @@
using System;
#if !UNITY_SWITCH
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
@ -156,3 +157,4 @@ namespace AxiReplay
}
}
#endif

View File

@ -82,7 +82,6 @@ namespace Essgee.Utilities
}
}
#endregion
public static void Write(this System.IO.BinaryWriter bw, byte* bufferPtr, int offset, int count)
{
// 使用指针复制数据到临时数组
@ -90,21 +89,22 @@ namespace Essgee.Utilities
// 使用BinaryWriter写入临时数组
bw.Write(TempBuffer_src, 0, count);
}
public static void Write(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count)
{
// 使用指针复制数据到临时数组
Buffer.MemoryCopy(bufferPtr + offset, TempBuffer, 0, count);
// 使用BinaryWriter写入临时数组
fs.Write(TempBuffer_src, 0, count);
}
public static int Read(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count)
{
// 使用BinaryWriter写入临时数组
count = fs.Read(TempBuffer_src, offset, count);
// 使用指针复制数据到临时数组
Buffer.MemoryCopy(TempBuffer, bufferPtr + offset, 0, count);
return count;
}
//public static void Write(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count)
//{
// // 使用指针复制数据到临时数组
// Buffer.MemoryCopy(bufferPtr + offset, TempBuffer, 0, count);
// // 使用BinaryWriter写入临时数组
// fs.Write(TempBuffer_src, 0, count);
//}
//public static int Read(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count)
//{
// // 使用BinaryWriter写入临时数组
// count = fs.Read(TempBuffer_src, offset, count);
// // 使用指针复制数据到临时数组
// Buffer.MemoryCopy(TempBuffer, bufferPtr + offset, 0, count);
// return count;
//}
}
internal unsafe static class AxiArray

View File

@ -39,6 +39,7 @@ namespace Essgee.Emulation
var fileExtension = System.IO.Path.GetExtension(fileName);
if (fileExtension == ".zip")
{
UnityEngine.Debug.Log("使用ZipFile.Open解压Zip:"+fileName);
using (var zip = ZipFile.Open(fileName, ZipArchiveMode.Read))
{
foreach (var entry in zip.Entries)
@ -60,7 +61,7 @@ namespace Essgee.Emulation
else if (fileExtensionSystemDictionary.ContainsKey(fileExtension))
{
machineType = fileExtensionSystemDictionary[fileExtension];
romData = System.IO.File.ReadAllBytes(fileName);
romData = EmulatorHandler.io.File_ReadAllBytes(fileName);
}
}
catch (Exception ex) when (!AppEnvironment.DebugMode)

View File

@ -1805,7 +1805,9 @@ namespace IngameDebugConsole
public void SaveLogsToFile( string filePath )
{
#if !UNITY_SWITCH
File.WriteAllText( filePath, GetAllLogs() );
#endif
Debug.Log( "Logs saved to: " + filePath );
}
@ -1815,7 +1817,7 @@ namespace IngameDebugConsole
if( !avoidScreenCutout )
return;
#if UNITY_2017_2_OR_NEWER && ( UNITY_EDITOR || UNITY_ANDROID || UNITY_IOS )
#if UNITY_2017_2_OR_NEWER && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IOS)
// Check if there is a cutout at the top of the screen
int screenHeight = Screen.height;
float safeYMax = Screen.safeArea.yMax;

View File

@ -1,4 +1,4 @@

#if !UNITY_SWITCH
using System.IO;
namespace MAME.Core
@ -81,4 +81,5 @@ namespace MAME.Core
mWriter.Flush();
}
}
}
}
#endif

View File

@ -93,7 +93,6 @@ namespace StoicGooseUnity
}
}
#endregion
public static void Write(this System.IO.BinaryWriter bw, byte* bufferPtr, int offset, int count)
{
// 使用指针复制数据到临时数组
@ -101,6 +100,7 @@ namespace StoicGooseUnity
// 使用BinaryWriter写入临时数组
bw.Write(TempBuffer_src, 0, count);
}
/*
public static void Write(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count)
{
// 使用指针复制数据到临时数组
@ -115,7 +115,7 @@ namespace StoicGooseUnity
// 使用指针复制数据到临时数组
Buffer.MemoryCopy(TempBuffer, bufferPtr + offset, 0, count);
return count;
}
}*/
}
internal unsafe static class AxiArray

View File

@ -3,7 +3,7 @@
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
@ -13,7 +13,7 @@ Material:
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 1
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
@ -43,4 +43,3 @@ Material:
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: 9dc7e810a87b444ab96919f3215c2fe5
timeCreated: 1523859834
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -66,6 +66,10 @@ namespace Coffee.UIExtensions
static void SaveMaterial(Material mat, Shader shader, bool isMainAsset)
{
#if !UNITY_EDITOR
return;
#endif
string materialPath = GetDefaultMaterialPath(shader);
#if UIEFFECT_SEPARATE

View File

@ -29,8 +29,8 @@ public class UMAME : EmuCore<ulong>
public UniTimeSpan mTimeSpan;
public bool bQuickTestRom = false;
public string mQuickTestRom = string.Empty;
public ReplayWriter mReplayWriter;
public ReplayReader mReplayReader;
//public ReplayWriter mReplayWriter;
//public ReplayReader mReplayReader;
public long currEmuFrame => emu.currEmuFrame;
public static System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
public static bool bInGame { get; private set; }
@ -125,7 +125,7 @@ public class UMAME : EmuCore<ulong>
{
emu.ResetRomRoot(RomPath);
//Application.targetFrameRate = 60;
mReplayWriter = new ReplayWriter(mChangeRomName, "fuck", ReplayData.ReplayFormat.FM32IP64, Encoding.UTF8);
//mReplayWriter = new ReplayWriter(mChangeRomName, "fuck", ReplayData.ReplayFormat.FM32IP64, Encoding.UTF8);
mChangeRomName = loadRom;
StopGame();
//读取ROM
@ -161,7 +161,7 @@ public class UMAME : EmuCore<ulong>
mUniKeyboard.SyncInput(InputData);
emu.UpdateFrame();
//写入replay
UMAME.instance.mReplayWriter.NextFramebyFrameIdx((int)UMAME.instance.mUniVideoPlayer.mFrame, InputData);
//UMAME.instance.mReplayWriter.NextFramebyFrameIdx((int)UMAME.instance.mUniVideoPlayer.mFrame, InputData);
return true;
}
@ -188,7 +188,7 @@ public class UMAME : EmuCore<ulong>
{
string Path = SavePath + Machine.sName + ".rp";
string dbgPath = SavePath + Machine.sName + ".rpwrite";
mReplayWriter.SaveData(Path, true, dbgPath);
//mReplayWriter.SaveData(Path, true, dbgPath);
}
public void StopGame()
{

View File

@ -121,34 +121,35 @@ public class UniKeyboard : MonoBehaviour, IKeyboard
}
}
public class ReplayMode
{
ulong currInputData;
// public class ReplayMode
// {
// ulong currInputData;
public ReplayMode()
{
}
// public ReplayMode()
// {
// }
public ulong GetPressedKeys()
{
int targetFrame = (int)UMAME.instance.mUniVideoPlayer.mFrame;
AxiReplay.ReplayStep stepData;
//有变化
if (UMAME.instance.mReplayReader.NextFramebyFrameIdx(targetFrame, out stepData))
{
#if UNITY_EDITOR
string ShowKeyNames = string.Empty;
foreach (string keyname in GetInputpDataToMotionKey(currInputData))
{
ShowKeyNames += keyname + " |";
}
Debug.Log("GetPressedKeys=>" + ShowKeyNames);
#endif
currInputData = stepData.InPut;
}
return currInputData;
}
}
// public ulong GetPressedKeys()
// {
// int targetFrame = (int)UMAME.instance.mUniVideoPlayer.mFrame;
// AxiReplay.ReplayStep stepData;
// //有变化
// if (UMAME.instance.mReplayReader.NextFramebyFrameIdx(targetFrame, out stepData))
// {
//#if UNITY_EDITOR
// string ShowKeyNames = string.Empty;
// foreach (string keyname in GetInputpDataToMotionKey(currInputData))
// {
// ShowKeyNames += keyname + " |";
// }
// Debug.Log("GetPressedKeys=>" + ShowKeyNames);
//#endif
// currInputData = stepData.InPut;
// }
// return currInputData;
// }
// }
#endregion
}