libretro / uae4arm-libretro

Port of uae4arm for libretro (rpi/android)
6 stars 8 forks source link

Savestates support for Vita version. #18

Open Snowbro88 opened 3 years ago

Snowbro88 commented 3 years ago

Hi again, I just wanted to ask if it is possible and what possibilities exist to add support for savestates in the Vita version of UAE4ARM ?, because many games are very long or very difficult, so it would be a very interesting option to be able to save and load when you want.

There must be a good reason why this core does not support savestates at this time, just ask if it really would be possible to add this function and if it can be considered for a future update.

Thanks.

Chips-fr commented 3 years ago

Savestate has been added in the more updated code base. It was easier than what i though so i was thinking it should be do-able in this version too...

Snowbro88 commented 3 years ago

Understood, we will be pending, thank you.

Chips-fr commented 3 years ago

You need to wait following pull is accepted: https://github.com/libretro/uae4arm-libretro/pull/19 I haven't tested on vita but it compiles...

Snowbro88 commented 3 years ago

Hello I can see that the necessary changes to support savestates in the Vita version have been applied, however I have not been able to check if this function works correctly in the last nigthly, because a colleague told me recently that apparently since version 1.9.4 retroarch stable or a little earlier the core does not work in any way in Vita (in any format and in any configuration), this is not related to the support for savestates, apparently something was modified in the period between a nigthly later to version 1.9.1 (where hdf and A1200 were corrected) and 1.9.4, which caused the core to stop working irretrievably, sorry for so many requests but it would be possible one last time to review this issue.

Thank you.

Chips-fr commented 3 years ago

There was no update in this repo in the time laps you indicated. It should be coming from libretro part. It's the only core impacted ? Perhaps an issue should be entered in libretro ? Any idea from vita developper @Uukrull @frangarcj ?

Snowbro88 commented 3 years ago

I'm not sure if other cores stopped working in its Vita version, what I use regularly still works, I already contacted developper frangar to see if he can help us with this problem, thanks for your interest, we are close to making this system work very completely in Vita.

frangarcj commented 3 years ago

I'll check it

frangarcj commented 3 years ago

Problem is here https://github.com/libretro/uae4arm-libretro/blob/master/src/jit/compemu_support.cpp#L218

Newlib gets full memory on retroarch, you need to tell how much vm memory to reserve.

There's a top value for vm memory on uae4arm ?

There's no available memory for dynarec, I'll take a look tomorrow.

Chips-fr commented 3 years ago

Thanks for this. I'm not familiar with vita and newlib constraint. From what I understand the error occurs in CPU/JIT allocation whereas JIT is has been deactivated since it crash on vita. So it should not be the biggest RAM consumer since only a small alloc occurs for cpu (To be confirmed). However I think we allocate quite a lot of RAM in alloc_AmigaMem. We allocate 96 MB (and not 64MB as indicated in some comments) which seems interesting in case of high end amiga emulation whereas we are targeting gaming here, so 16MB should be enough. If we miss of RAM could it be a solution too ? Anyway if your solution works then that's good...

frangarcj commented 3 years ago

It's a matter of pools. Newlib was allocating full vita memory and not leaving anything for mmap. It's strange it works before.

Snowbro88 commented 3 years ago

I can confirm that after the changes made by frangarcj the Vita version of this core works again without any problem, I can also confirm that the function for savestates works correctly, I have tested it with games in hdf format and without any problem for the moment, thank you both very much for your work and interest.

Chips-fr commented 3 years ago

Thanks for feedback, good to know everything works.