SK.Libretro
SK.Libretro copied to clipboard
Problem when loading new games
Hello, i have a problem when i try to stop a game and run another game. i am workin whith vr (xr plugin), the core with i have this problem is nestopia (i don't have try if the prblem is present also with other core). to change game i use this function: libretro.PauseContent(); libretro.StopContent(); libretro.StopAllCoroutines(); libretro.DeInitialize(); libretro.Initialize("nestopia",libretro.Directorygioco, gioco); //libretro.Directorygioco is a variable that determine the path of the directory with application.datapath libretro.StartContent();
initially i tryed only with stopcontent() and startcontent(); i also have tryied to divide the function that stop the content and the function that start the content, but i have ever the following errors:
System.NullReferenceException: Object reference not set to an instance of an object This Exception was thrown from a job compiled with Burst, which has limited exception support. 0x00007ffbfc112762 (6014b71d4bad33b1c4b7c491bf53611) d13c9e1d2b2bc6d8b49ea59eabf9054c 0x00007ffbfc11236d (6014b71d4bad33b1c4b7c491bf53611) d13c9e1d2b2bc6d8b49ea59eabf9054c 0x00007ff72ed7f54f (Unity) 0x00007ff72ed7f8b4 (Unity) 0x00007ff72ed805ef (Unity)
System.NullReferenceException: Object reference not set to an instance of an object This Exception was thrown from a job compiled with Burst, which has limited exception support. 0x00007ffbfc112762 (6014b71d4bad33b1c4b7c491bf53611) d13c9e1d2b2bc6d8b49ea59eabf9054c 0x00007ffbfc11236d (6014b71d4bad33b1c4b7c491bf53611) d13c9e1d2b2bc6d8b49ea59eabf9054c 0x00007ff72ed7f54f (Unity) 0x00007ff72ed7f8b4 (Unity)
InvalidOperationException: The Unity.Collections.NativeArray`1[System.Single] SampleBatchJob.DestinationSamples has been deallocated. All containers must be valid when scheduling a job. Unity.Jobs.LowLevel.Unsafe.JobsUtility.ScheduleParallelFor (Unity.Jobs.LowLevel.Unsafe.JobsUtility+JobScheduleParameters& parameters, System.Int32 arrayLength, System.Int32 innerloopBatchCount) (at <10871f9e312b442cb78b9b97db88fdcb>:0) Unity.Jobs.IJobParallelForExtensions.Schedule[T] (T jobData, System.Int32 arrayLength, System.Int32 innerloopBatchCount, Unity.Jobs.JobHandle dependsOn) (at <10871f9e312b442cb78b9b97db88fdcb>:0)
if i deactivate burst compiler, i have the following errors:
InvalidOperationException: The Unity.Collections.NativeArray`1[System.Single] SampleBatchJob.DestinationSamples has been deallocated. All containers must be valid when scheduling a job. Unity.Jobs.LowLevel.Unsafe.JobsUtility.ScheduleParallelFor (Unity.Jobs.LowLevel.Unsafe.JobsUtility+JobScheduleParameters& parameters, System.Int32 arrayLength, System.Int32 innerloopBatchCount) (at <10871f9e312b442cb78b9b97db88fdcb>:0) Unity.Jobs.IJobParallelForExtensions.Schedule[T] (T jobData, System.Int32 arrayLength, System.Int32 innerloopBatchCount, Unity.Jobs.JobHandle dependsOn) (at <10871f9e312b442cb78b9b97db88fdcb>:0) SK.Libretro.Unity.AudioProcessor+<>c__DisplayClass12_0.<ProcessSampleBatch>b__0 () (at C:/Users/Masseria/Desktop/SK.Libretro-master/Unity/Scripts/Runtime/Audio/AudioProcessor.cs:100) SK.Libretro.Unity.MainThreadDispatcher+<>c__DisplayClass5_0.<Enqueue>b__0 () (at C:/Users/Masseria/Desktop/SK.Libretro-master/Unity/Scripts/Runtime/Utilities/MainThreadDispatcher.cs:60) SK.Libretro.Unity.MainThreadDispatcher+<>c__DisplayClass4_0.<Enqueue>b__0 () (at C:/Users/Masseria/Desktop/SK.Libretro-master/Unity/Scripts/Runtime/Utilities/MainThreadDispatcher.cs:56) SK.Libretro.Unity.MainThreadDispatcher.Update () (at C:/Users/Masseria/Desktop/SK.Libretro-master/Unity/Scripts/Runtime/Utilities/MainThreadDispatcher.cs:53) System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <787acc3c9a4c471ba7d971300105af24>:0) UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <10871f9e312b442cb78b9b97db88fdcb>:0) UnityEngine.UnitySynchronizationContext.Exec () (at <10871f9e312b442cb78b9b97db88fdcb>:0) UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <10871f9e312b442cb78b9b97db88fdcb>:0)
NullReferenceException: Object reference not set to an instance of an object SK.Libretro.Unity.FrameXRGB8888Job.Execute (System.Int32 index) (at C:/Users/Masseria/Desktop/SK.Libretro-master/Unity/Scripts/Runtime/Graphics/Jobs/FrameXRGB8888Job.cs:45) Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[T].Execute (T& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <10871f9e312b442cb78b9b97db88fdcb>:0)
NullReferenceException: Object reference not set to an instance of an object SK.Libretro.Unity.FrameXRGB8888Job.Execute (System.Int32 index) (at C:/Users/Masseria/Desktop/SK.Libretro-master/Unity/Scripts/Runtime/Graphics/Jobs/FrameXRGB8888Job.cs:45) Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[T].Execute (T& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <10871f9e312b442cb78b9b97db88fdcb>:0) Unity.Jobs.JobHandle:ScheduleBatchedJobsAndComplete(JobHandle&) Unity.Jobs.JobHandle:Complete()
have you some idea ofhow i can solve those problems? Thankyou for your support
Using only StopContent() -> Initialize(...) -> StartContent(), I can swap games on nestopia without any errors.
What does the resulting string for "libretro.Directorygioco + gioco" look like after the Initialize line?
the string look correct, i have these errors when i stop the play in unity
If it's just stopping play mode in unity, the thread probably doesn't have enough time to complete, using a weaker cpu or something else, either way I can't reproduce this.
I understand you get the error message but your actual problem is unclear. Does the old game stop, and does the new one start? If so, then it's fine (at least not related to swapping roms).