-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kirameki School Life SP won't get in-game, black screen. #1550
Comments
Well, the problem is the NULL pointer jump. It'd be nice to see the log before the first invalid memory access (you can make it stop emulation at the first one with the last option under Options.) -[Unknown] |
I just noticed that clicking "no" when the syscall appears, Visual C++ starts reporting things. I think it's a different problem, should I leave that for another issue? By the way, the new 8 MB log is here: I'll try again leaving the invalid addresses ignored and enable them only before the black screen appear. |
Hmm, well, it's probably related. This first issue seems psmf related. It's hard to say if it's impacting stuff later or not. Probably because we make the psmf end immediately and the game was not expecting that. For the unknown syscalls, can you paste the .map file (save from the Debug menu in the emulator) in a gist or pastebin? Or else, the log - it has the bad syscalls at the top too. We should at the very least stub them. -[Unknown] |
Confirming that the syscalls are a thing of this game, they aren't happening when I load Fate/EXTRA CCC or Amagami EbiKore Plus. While, if I try to load Boku wa Tomodachi ga Sukunai (which is made by the same producers of Kirameki), the unknown syscalls happen again. I'll post all details from VC++ in 5 mins. |
Unknown Syscall stack trace: Log generated until now (it's paused since I clicked "no" in the first syscall window): I can't see or click the emulator window for some reason while the debug is paused, I'll try to save a map file in some way. EDIT: I forgot to say, this is all about only the first syscall, to get the details of the second I think I've to resume the debug, if you don't need more details for the first one. I'm going to get some pizza, brb 30-40 mins (I'll leave everything running so if you need more details just write it here). |
Here are the syscalls. In this case, the stack trace isn't very interesting because I know where it generates the message that the syscall is unknown. 41:40:449 hle\hle.cpp:227 I[HLE]: Syscall (sceMp4,68651cbc) unresolved, storing for later resolving Hmm. Those are sceMp4Init and sceMp4Finish respectively, according to Google. You could try creating stubs for them in sceMpeg let's say, and returning either 0 or -1 and see if they change anything. To do this, you'd have to add a couple things, but it's not too hard:
At this point it'll stop warning about the syscall. Then you can stub them by changing the table:
Above that add the func:
Returning 0 or -1 there might help the game, or it might do nothing. More correctly, there would be two functions, sceMp4Init and sceMp4Finish, and they would have parameters (and the WrapI_XXX would be changed to match the parameter types.) -[Unknown] |
@unknownbrackets , with that much work on a post you might as well have sent a pull request :) Adding those stubs shouldn't hurt. |
Heh, but it sounds like @KyousukeKyaa is interested in debugging it. I think it's more fun that way. -[Unknown] |
I'll try, it's a chance to learn something about MS Visual C++. I did it untill phase 4 ("Add a call to Register_sceMp4(); from Core/HLE/HLETables.cpp right next to the sceMpeg one") and tried to continue the debug before changing the table (at this point I had to do it, right?) but VC++ said there were 3 errors: I tried once again to resume the debug without modifying anything and the whole screen went black for a few seconds, then the second syscall window appeared (I guess it worked!). Now I'm going to change the table as you wrote and then I'll post more details about the second syscall. |
In sceMpeg.h, you want it to look like the sceMp3 and sceMpeg ones - that is, with just a -[Unknown] |
My fault, did it have no effect then? if so I've to restart again the debug from the first syscall. |
Yeah, it didn't compile so it ran the old version I think. -[Unknown] |
I tried again using ; at the end and moving the position of the code (it was after sceMp3 and now is above, between sceMpeg and sceMp3) but it's giving the same error messages, maybe I did it wrong in the other files? This is the modified sceMpeg.h: HLETables.cpp sceMpeg.cpp: Is there any syntax error? |
The .h file is a "header" file, it just defines the names of functions. It should just look like this:
Without the part inside the The other files look okay. -[Unknown] |
Omg I didn't get it before /facepalm now I understand. In facts, it works now even though it returns this: I guess that's because I didn't change the table yet, going to do it now. |
Hmm, that's strange. I've never seen that error before... It's true that a global static variable was added though... not sure why it's an error. But yeah, might help to try the table. Are you restarting the emulator when changing the code? If not, that could be why as well. -[Unknown] |
👍 yep it was that, I had to stop the debug and start a new one and this time with the modified table there were no syscalls... Approved! Now, back to the in-game problem! xD |
Just tried to play, in the main menu I unchecked "Ignore illegal reads/writes" before pressing x (or O on the psp interface) and this invalid access appeared in the console after pressing x: This is the map file: Log here: |
So if you want to give it a shot (and split it into two functions like the rest), it might be good to commit and send a pull request. It should have a comment that the parameters aren't filled in yet and probably an ERROR_LOG inside it (like many other functions.) About the next problem (memory error), let's take a look at Core/HLE/scePsmf.cpp (it appears twice):
This is probably too early. For now (as a hack you wouldn't necessarily want to send a pull for), maybe try:
The idea here is that after the game calls this 1000 times, it will end the video. This might be long enough that something else the game is expecting to happen will work out. This isn't really a proper fix, but it can eliminate whether or not this is even causing the later problem or not (if it makes the memory access errors go away.) If those errors go away, but it still dies at the menu, that means the menu has a different problem. -[Unknown] |
I applied that change to the file and ran a new test without ignoring illegal reads/writes, but the same error appeared in the console (core\memmapfunctions.cpp:123 WriteToHardware: Invalid address 50bf37a8). Log here: The map file is identical to the previous one: By the way, I'm still using that zip from the outdated revision, is that alright or is better to continue using the latest zip? |
The map file won't change, it just shows what functions the game uses. I guess it could change if it loaded more modules. Well, I'd suggest using GitHub for Windows, which can update without redownloading everything from scratch. It's pretty easy to use too. But, you can stick with this version or download the latest, either way. Anyway, it's very interesting if this changed the behavior later on. The reason I suspect it may be related to psmf is this in the log:
Notice the "50bf37a8" (which is definitely a totally invalid memory address) looks similar to the addresses used earlier. Even if it's not caused by scePsmf bugs, the bad address probably "originates" there. We know the game isn't supposed to hit those, because it'd crash if it hit them on a real PSP. Unfortunately, I don't see why it's trying those addresses... -[Unknown] |
About the sceMp4 commit, can I send directly a pull request with the final version of the code (the modified table and int return 0) or it has to be done in two times, like I did when I was debugging? EDIT: I missed the raven02 commits, ok. |
I was writing about the first invalid address but I think I deleted my post accidently. Anyway, there's another invalid address that happens before the "press any button" screen (before reaching main menu), it might be related to the intro video that's supposed to appear at that point. I was ignoring this before because I was focusing on the "getting in-game", when you wrote it appears twice were you referring to that? |
Right, well, if you look at the log (as posted above), it's clustered shortly after a sceKernelDeleteThread(), which is interesting. The second and third set have the same address that crashes later, so it's probably related... It kinda gets hard here, finding where the memory address comes from... -[Unknown] |
Something new just happened, I never tried to see what happens clicking on the other 2 options from main menu while debugging, so far I just browsed the settings and tried to start the game, I totally forgot about them.. Clicking the bottom-right selection in main menu (ignoring illegal reads/writes), returns this loop in the console: The log file is over 200MB I'll try to split it in 15-20 parts if you want to browse it. Pasted here: I'm taking screenshots for each trace and the respective variables, I'll post in 5-10 mins. |
Weird, hard to say. It crashed trying to save ppsspp.ini. Something is definitely not going the game's way as far as memory addresses... anyway, what's most interesting is the syscalls before those bad memory addresses start. Usually (not always, just usually) it's related to a syscall it just called. -[Unknown] |
Screens here: Until now the syscall window didn't pup up, maybe if the debug continues. Generates a 392MB file "RES.DAT" under "...\JPCSP\ms0\PSP\SAVEDATA\ULJS00458DAT" |
Ok I ran 3 tests, the first using -1 and there were some graphic glitch (random text appearing on the screen for a shot time), the console returned this: Log and details: http://limelinx.com/dit4m The second time (keeping -1) with the modified sceKernelThread.cpp the result was: Log here: http://limelinx.com/ls9i The third test was same as the second, only changing -1 back to 0: Log and details: http://limelinx.com/dkzae I'll try again 4 tests ignoring the invalid addresses. |
Done 6 tests, it took a while because I messed up the screenshots but, was a good thing in its own way.
Log and infos: http://limelinx.com/b5q5i
Log and infos: http://limelinx.com/cq6ra
4)This is the interesting one (always using return -1), the console started looping this: When I closed PPSSPPDebug.exe, VC++ reported something: Log and infos about the stack trace: http://limelinx.com/e4w6e Log and infos: http://limelinx.com/flhy Log and infos: http://limelinx.com/003q |
Hmm, strange. Interesting that so many different things can happen, but I don't know why, yet, sorry. -[Unknown] |
Did that log from VC++ contain anything new? I couldn't save any screenshots of the auto variables, for some reason the window is totally disappeared from VC++ interface, I'm still trying to understand what I did wrong. Now I'm converting a gameplay video for YT, it should be ready in 30-40 mins if you want you can check it later. It was recorded from the beginning, to the part where the prologue ends, it might help to better understand how this game works. EDIT: Link to the vid: About the log, it's filled with lines like these (I think the same as before): Download: http://limelinx.com/erft6 This game is funny, in 2 different ways: for the game contents and for the strange things that it's asking to the emulator. I think VC++ won't work for a while, I should /format to fix the error problem but atm I don't have the windows 7 installer dvd here, it's gonna take a while. |
I didn't restore VC++ yet but, I can use the debug console playing the Orphis' builds for now, just tried r382 (e23b226) Then, reading MemmapFunctions.ccp (li 91) it's something related to JIT, so I tried playing again disabling JIT from the game options and the result was different, the game lagged a lot and there were glitches in the colors, the console reported different things. Log: http://limelinx.com/cwfvm As I've seen from the other issues about other games with the same problem, it's something windows-related. |
Hmm, not sure. ReadFromHardware is actually a PPSSPP function, not a Windows function (or at least, we don't use the Windows function.) It means that the game, probably due to the results of a syscall or badly emulated CPU instruction, tried to access a memory address that is invalid. On the PSP, the game would crash if this happened. So it means something went wrong before that for it to use that address. -[Unknown] |
I see, it might be related to some ignored invalid access that happen before that point? in all these tests the invalid accesses were ignored, there were too many so I just disabled them.. xD but if that's the cause, I'll try checking them all. |
How is this game looking lately? Still has issues? -[Unknown] |
I missed a lot of progress! a lot of stuff is fixed in the latest build v0.8.1 r63 b12604 (32 bits), like the opening videos (now they're working) and some graphic glitches[*] (the black square that used to be in some fading scenes is no more, I can see the background now). Played for a while ignoring the addresses, the debug window was really kicking though, but it didn't crash until I tried to save the game, it crashed while loading the available save slots, like it used to crash here: #1550 (comment) Log saved here: http://limelinx.com/b9ink The opening videos were muted but that's probably because I didn't try the new audio plug-in yet, there's a lot that I've to update... xD I'm working on a project for a blog atm but one of these days I'm going to test everything like before, this summer I'll get a new hdd too, so I can finally set up a virtual machine and reinstall that crappy visual studio, microsoft really kills the motivation... EDIT: installing the audio plug-in using PPSSPP was really easy, 100% working even in opening videos and it sounds great, music/voices/se aren't rusty anymore! that's amazing... I'm wanna cry, this emulator is progressing at light-speed! |
Hmm this isn't good: C++ runtime abort: terminate() called by the exception handling mechanism I wonder what is causing that... -[Unknown] |
How does this game look these days? -[Unknown] |
I can't believe that I finally found the cause of that linker error.. it wasn't the incremental linking but just a conflict with multiple versions of |
Today I tried to run a debug and noticed a visual glitch similar to something that before[*] was fixed in a previous build: The right side of the screen was flickering (that white/pink square is not supposed to be there), but that happens only when a 3d model (like the girl on left) is fading or appearing, in that moment it was appearing. After playing for a few minutes, saved and loaded different times (no problems about that), during a transition from a scene to another, PPSSPPDebug.exe stopped and VC++ reported this:
Screenshot of the frozen ppsspp window (couldn't click anything, not even the dropdown menus): VC++ stack trace: Screenshots: VC++ Output [Debug]: This is last line from PPSSPP debug console:
All 9999 lines from PPSSPP debug console: Everything above and more: @Mega About the log, how do you use |
Right click the PPSSPPWindows project -> Properties -> expand Configuration Properties -> Debugging -> Enter the command-line args you want into Command Arguments. Then start debugging PPSSPP as usual. |
I forgot to say that this time I didn't modify any settings nor files (linker, dx sdk or anything like that), so the build was clean, using the files as they were downloaded from github (time of commit 9c7e21c29c). |
Hmm. Feels like stack corruption to me but I'm not sure. I recommend disabling "fast memory" in settings. It will prevent crashes from things like that (it will still log.) The game might go on. But we should find why it's doing that. -[Unknown] |
Invalid address freezing have been fixed by @unknownbrackets #5368 ,graphic glitch is still happening. |
That's good. The graphic glitch is the black columns, right? Could be a block transfer/memory copy issue. -[Unknown] |
It is the extra picture come out. |
Ah, yeah, that definitely looks like either an FBO being kept alive or memset/memcpy/block transfer/dma type stuff. -[Unknown] |
Does this do any better in the latest git buids with simulate block transfer and etc.? -[Unknown] |
Graphics has not been improved yet with the latest build v0.9.8-1614-g459e244 |
@daniel229 I think that last change fixed this, is that right? Is there anything left? -[Unknown] |
Well, it's making copies... without making an emulator for this game specifically or patching this game, it's probably not avoidable. I mean, we could track that it's a copy, but we'd have to track all memory writes, and it'd be very slow. -[Unknown] |
Update - Now, this game is Playable (#1550 (comment))
After the recent fix (#1532), it's possible to see the main menu and game settings but when I try to start playing, the game stops working and the screen freezes to black.
Two screenshots of the console:
25 MB of log here:
http://limelinx.com/fp4am
The text was updated successfully, but these errors were encountered: