ffman1985 Posted January 5, 2023 Share Posted January 5, 2023 When loading a savestate of cps2 games the emulator will freeze. But it is ok to create the savestate. It is tested on the latest and a 2 months old version. Thank you for the attention. 1 Link to comment Share on other sites More sharing options...
Tux Posted January 5, 2023 Share Posted January 5, 2023 specific to windows 64 bits -> don't use cps2 in windows 64 bits for now. 1 Link to comment Share on other sites More sharing options...
ffman1985 Posted January 5, 2023 Author Share Posted January 5, 2023 I just tested on a very old version (0.92), the problem does not exist. Maybe I use this version for now. 1 Link to comment Share on other sites More sharing options...
Tux Posted January 5, 2023 Share Posted January 5, 2023 (edited) There seems to be an unstability with the recent gcc (12.2) in windows only and in 64 bits only, and only for the cps2 driver afaik ! so as long as there is no update on their side I don't think I will be able to do much on mine. The alternatives are indeed : switch to 32 bits, to linux, or revert to an old version. If you are happy with an old version then excellent ! I am not 100% certain it's gcc fault, there might be a buffer overflow somewhere, but if there is one, it's extremely hard to find : it happens only when the build is optimized, so no debug build allowed, and only in windows 64 bits, so far I wasn't able to find anything, but I miss a good tool to track buffers overflows like the good old electric fence which doesn't work on our modern systems... I'll try to look again later, but no promise here... ! Edited January 5, 2023 by Tux 1 Link to comment Share on other sites More sharing options...
Tux Posted January 5, 2023 Share Posted January 5, 2023 (edited) Ok, finally fixed everything. The trick with this kind of problem is that even if debug info is not allowed, if it crashes, you can track it with a debuger and with enough patience you finally find the cause. There were actually 2 problems here : 1) a very very old bug, there is an array for layers and layers priorities in cps1/cps2, so I reserved 3 members for these 2 arrays since there are 3 layers. Except that sprites are seen also as a layer in this driver ! So I needed 4 spaces ! And why did it crash just now ? Apparently because gcc decided to change the way variables were allocated in this version for win64, before it was harmless, I don't know where it landed but it was unnoticeable, and with this change from them, it became the end of the world ! 2) a very optimistic speed hack module, that's why save games were crashing sometimes. It was storing the data it needed in the save by assuming variables were allocated in memory as they appeared in the source. It's clearly not the case anymore in the latest gcc, and anyway it's a bad assumption. So I moved everything to a struct and now this bug is gone too ! (I don't guarantee old savegames using this module will be compatible, it's used at least by cps1/cps2, but not only). So finally gcc was not guilty, it just allowed me to find some old bugs... Now I am a little tired so I don't promise a release just now, but it should be good for tomorrow or maybe a little later... ! Edited January 5, 2023 by Tux 1 Link to comment Share on other sites More sharing options...
mer-curious Posted January 5, 2023 Share Posted January 5, 2023 Great work Tux! 😀 I'm happy that the CPS1 and 2 save state function is finally operational again in Raine64. Thanks to ffman1985 for spotting and reporting this bug. 👍 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now