Jump to content

A few issues with NGCD emulation (and SSRPG...)


mer-curious

Recommended Posts

Hello Tux! I was recently playing with Raine and stumbled upon some issues in the NGCD emulation. I was playing with the Samurai Shodown RPG game, but perhaps it could affect other games too. Here are the issues I found:

 

1:

In Samurai Shodown RPG if you cut the introduction audio track and go to the game title screen and then show the GUI, the introduction track will restart when you leave the GUI. You can see the effect in this video clip:

https://drive.google.com/file/d/1H8WzvmHJhfJl6qseZbDixAyRpbYSha61/view?usp=sharing

 

2:

The load state/save state graphical function is broken for NGCD games, as you see in this clip:

https://drive.google.com/file/d/1WjbanP6buOZqf5yHYEtXZ_b-o-Vhecgg/view?usp=sharing

I guess you forgot to fix it for NGCD games when you made the changes in this function.

 

3:

Raine is freezing in Samurai Shodown RPG if you die and quit to the title screen before the introduction music starts. You can see the issue happening in this clip:

https://drive.google.com/file/d/1JalmutZp87d-rEHWH_TuLNgaCNZ868t-/view?usp=sharing

If you let the introduction music play the freeze won't happen, which is interesting...

I have a save state before dying so you could try reproducing this issue. Just let the character die and quit to the title screen and then press the button before the introduction music plays. Here's the file:

https://drive.google.com/file/d/1mOf-rcHzDJjwxYl_TY0jeaNyxzUhPhui/view?usp=sharing

I created this save state after loading a NG game with sound associations. Perhaps this could have triggered this weird freezing...

 

4:

The sound is choppy in this save state. See in the video here:

https://drive.google.com/file/d/1yIhRL87-bx5hYJa-OXRma_n0QSjysj-G/view?usp=sharing

Save state file:

https://drive.google.com/file/d/1dd6wB27OcLmBl8Er-m_Hcf7zYXBG2Gyt/view?usp=sharing

I'm not sure why this is happening with this state. I created it from the previous state in order to speed up the character dying process. Perhaps this could be related to that...

But if you let the character die and continue the game, you'll see the audio is correct, so it's just with this battle track...

 

Anyway, hopefully you'll be able to reproduce and fix some of these issues eventually.

Thank you so much in advance for your time and work.

Edited by mer-curious
Link to comment
Share on other sites

Sorry I stopped ! ;-)

I'll reply to 1 anyway : just don't do that ! Without kidding, I have played quite a lot this game since I tested this translation long ago and I never called the gui while on the main menu. It's interesting to know there is a bug here and it's probably something very stupid, but I don't want to spend time on it for now, sorry !

And I didn't even read past that ! (maybe I'll do later though)

Link to comment
Share on other sites

  • 3 weeks later...
Posted (edited)

Hello Tux! I saw some recent changes in the Raine code in GitHub and your post about it in the other thread. I hope you may get some motivation to check these bugs with SSRPG eventually. 🙏

 

On 4/7/2024 at 10:46 AM, Tux said:

I'll reply to 1 anyway : just don't do that ! Without kidding, I have played quite a lot this game since I tested this translation long ago and I never called the gui while on the main menu.

Yes, I can avoid that by not visiting the GUI. I stumbled upon this bug by going to the GUI to check the save states to try to reproduce the crash (and then I found that the save states information is broken for NGCD games in the GUI...).

Anyway, one thing took to another apparently in this case...

I wish I had reported all these bugs back in January, but I was a little busy then unfortunately to play with the SSRPG translation.

Thank you for your attention.

Edited by mer-curious
Link to comment
Share on other sites

Yeah and the heat became deadly in Brazil too, I guess you don't think about video games when it's getting so hot...

How much was it already ? I think it was about 60° C felt, some good 40°C base + 20° C felt because of > 90% humidity, you could call that the suburb of hell... !

Anyway you are probably seeing the end of it for now for this year, and it's going to be our turn... for now we are lucky... !

 

  • Like 1
Link to comment
Share on other sites

For your problems with the gui and the savegames : well the function has been here for years, and nobody ever reported anything (or used it maybe, that's my case I never used it, it explains why it has some bugs !). So the obvious workaround is to use the good old method : the keyboard with f2/f3/f4 keys, it should do all you need.

Link to comment
Share on other sites

  • 1 month later...
On 4/29/2024 at 5:24 AM, Tux said:

For your problems with the gui and the savegames : well the function has been here for years, and nobody ever reported anything (or used it maybe, that's my case I never used it, it explains why it has some bugs !). So the obvious workaround is to use the good old method : the keyboard with f2/f3/f4 keys, it should do all you need.

Hello Tux! I know about this work-around, but using the GUI for those functions is more user-friendly when we are playing from the couch and no wire-less keyboard is available. But specifically talking about this very bug, I think it maybe was introduced when you fixed the GUI issue for the arcade ROMs. You simply forgot to extend the fix for the NGCD games...

Anyway, I hope you can get some motivation to take a look at these bugs eventually. They are easy to reproduce here, so they should be easily fixable I guess...

Raine is still very unique in the sense that it has a full-screen user interface which works quite satisfactorily for a stand-alone emulator. It also features NGCD loading speed control and sound commands associations for many Neo Geo games (and for some other systems too). There is no other emulator out there with those features yet.

Thank you again for your time.

Link to comment
Share on other sites

Finally I took a little time to look into these :

1) that's where you see that neocd games which actually pause the cd instead of really stopping it are very rare, in fact I know only this one, and that's why it was unnoticed for so long ! Anyway, there should be a fix in place for all the cases now...

2) ncd_ prefix ok.

3) Can't reproduce, if you mean you can't select the entries in the main menu after dying if you go there before the cd track of the intro has time to play, it seems to work fine for me. Notice that I still have the old translation when it was in beta and the new one, and they are incompatible if you use save states ! I didn't think there were such severe modifications between them... ! And your save state was useful because all my save states were from 2015 or before and so were using only the asm core, but with current debug build you get a lot of early exits from the sanitizer because it doesn't recognize the stack structure because of all this asm in neocd. Only way around it is to use the C core instead of the asm core, but it requires a new save.

4) don't know, probably not worth investigating. I guess you should try to avoid save states if you want to play the way the game was designed, their save system is not that bad (if you forget the **** random events !).

  • Like 1
Link to comment
Share on other sites

Hello Tux!

Thank you so much for taking the time to fix some of those issues.

I've just tried the recently released version 0.96.8 and here's my feedback on these bug reports:

1) Fixed indeed and working perfectly!

2) I can't test it now because the Game options menu disappeared from the main menu when playing a NGCD game. It must have been something to do with the recent fix in this function I guess...

3) I can still consistently reproduce it here. You can still select the options in the game but there will be no sound at all, and then you cannot close the program because something has crashed it. I have another video clip now recorded in version 0.96.8:

https://drive.google.com/file/d/1nUVe1f5fMzueAX83r-imEpXaA2fSchsx/view?usp=sharing

You can use the same save state file in the new Raine version to try to reproduce it. Just make sure you cut the intro before the music starts as you see in the video above. I have the 1.1 version of the "perfect translation" downloaded from CDRomance, but my CUE file is like this:

FILE "Samurai Shodown - Tales of the Bushido - Track 01.bin" BINARY
  TRACK 01 MODE1/2352
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 02.mp3" MP3
  TRACK 02 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 03.mp3" MP3
  TRACK 03 AUDIO
    INDEX 01 00:00:00    
FILE "Samurai Shodown - Tales of the Bushido - Track 04.mp3" MP3
  TRACK 04 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 05.mp3" MP3
  TRACK 05 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 06.mp3" MP3
  TRACK 06 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 07.mp3" MP3
  TRACK 07 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 08.mp3" MP3
  TRACK 08 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 09.mp3" MP3
  TRACK 09 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 10.mp3" MP3
  TRACK 10 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 11.mp3" MP3
  TRACK 11 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 12.mp3" MP3
  TRACK 12 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 13.mp3" MP3
  TRACK 13 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 14.mp3" MP3
  TRACK 14 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 15.mp3" MP3
  TRACK 15 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 16.mp3" MP3
  TRACK 16 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 17.mp3" MP3
  TRACK 17 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 18.mp3" MP3
  TRACK 18 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 19.mp3" MP3
  TRACK 19 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 20.mp3" MP3
  TRACK 20 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 21.mp3" MP3
  TRACK 21 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 22.mp3" MP3
  TRACK 22 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 23.mp3" MP3
  TRACK 23 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 24.mp3" MP3
  TRACK 24 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 25.mp3" MP3
  TRACK 25 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 26.mp3" MP3
  TRACK 26 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 27.mp3" MP3
  TRACK 27 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 28.mp3" MP3
  TRACK 28 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 29.mp3" MP3
  TRACK 29 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 30.mp3" MP3
  TRACK 30 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 31.mp3" MP3
  TRACK 31 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 32.mp3" MP3
  TRACK 32 AUDIO
    INDEX 01 00:00:00

4) I can also reproduce this one in the new version. Hopefully fixing the crash could fix this too as a side effect maybe...

Anyway, thank you again for taking the time to trying fixing these issues.

Link to comment
Share on other sites

3 hours ago, mer-curious said:

Hello Tux!

Thank you so much for taking the time to fix some of those issues.

I've just tried the recently released version 0.96.8 and here's my feedback on these bug reports:

1) Fixed indeed and working perfectly!

2) I can't test it now because the Game options menu disappeared from the main menu when playing a NGCD game. It must have been something to do with the recent fix in this function I guess...

3) I can still consistently reproduce it here. You can still select the options in the game but there will be no sound at all, and then you cannot close the program because something has crashed it. I have another video clip now recorded in version 0.96.8:

https://drive.google.com/file/d/1nUVe1f5fMzueAX83r-imEpXaA2fSchsx/view?usp=sharing

You can use the same save state file in the new Raine version to try to reproduce it. Just make sure you cut the intro before the music starts as you see in the video above. I have the 1.1 version of the "perfect translation" downloaded from CDRomance, but my CUE file is like this:

FILE "Samurai Shodown - Tales of the Bushido - Track 01.bin" BINARY
  TRACK 01 MODE1/2352
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 02.mp3" MP3
  TRACK 02 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 03.mp3" MP3
  TRACK 03 AUDIO
    INDEX 01 00:00:00    
FILE "Samurai Shodown - Tales of the Bushido - Track 04.mp3" MP3
  TRACK 04 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 05.mp3" MP3
  TRACK 05 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 06.mp3" MP3
  TRACK 06 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 07.mp3" MP3
  TRACK 07 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 08.mp3" MP3
  TRACK 08 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 09.mp3" MP3
  TRACK 09 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 10.mp3" MP3
  TRACK 10 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 11.mp3" MP3
  TRACK 11 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 12.mp3" MP3
  TRACK 12 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 13.mp3" MP3
  TRACK 13 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 14.mp3" MP3
  TRACK 14 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 15.mp3" MP3
  TRACK 15 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 16.mp3" MP3
  TRACK 16 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 17.mp3" MP3
  TRACK 17 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 18.mp3" MP3
  TRACK 18 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 19.mp3" MP3
  TRACK 19 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 20.mp3" MP3
  TRACK 20 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 21.mp3" MP3
  TRACK 21 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 22.mp3" MP3
  TRACK 22 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 23.mp3" MP3
  TRACK 23 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 24.mp3" MP3
  TRACK 24 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 25.mp3" MP3
  TRACK 25 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 26.mp3" MP3
  TRACK 26 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 27.mp3" MP3
  TRACK 27 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 28.mp3" MP3
  TRACK 28 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 29.mp3" MP3
  TRACK 29 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 30.mp3" MP3
  TRACK 30 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 31.mp3" MP3
  TRACK 31 AUDIO
    INDEX 01 00:00:00
FILE "Samurai Shodown - Tales of the Bushido - Track 32.mp3" MP3
  TRACK 32 AUDIO
    INDEX 01 00:00:00

4) I can also reproduce this one in the new version. Hopefully fixing the crash could fix this too as a side effect maybe...

Anyway, thank you again for taking the time to trying fixing these issues.

2) really maximum annoy system here, it's indeed because of the move of the ips function, I had thought I had taken care of this part but I have been too fast, it's a tricky part where you must be super careful or you do this kind of mistake. Super annoying, really !
It's a 1 line fix, but without this one you loose "play game" and "game options" in most games, I guess I'll have to release a quick fix binary because of this stupid line.

3) still can't do, I even tested with the win version. I don't know which version I have, it's the original untouched with the bin files for audio tracks, I guess I decided to keep it this way because it's a rare format. Anyway : loading your state from the main menu of the game, pressing turbo until reaching the continue menu, pressing quit to title, pressing 1 so fast that you don't even see the white title appearing (tried also after the title has appeared), reaching the main menu, everything is normal and sound is working.

4) very unlikely, it's related to the timers usually and when it happens it's baked into the save, I guess this save was done at a bad moment, but I can't guess which one. Raine has gone a long way to improve this kind of reliability when restoring sound, but there are obviously still cases where it's broken. I have taken the time to check the restoration of timers here, everything seems fine, so no idea what's going on. From the sound of it it sounds like something bad is looping, maybe a bad bank ? But the banks are supposed to be saved and restored here, so no idea. Anyway you seem to think it's an easy problem, it's not, it's a very complex one.

 

Link to comment
Share on other sites

Hello Tux! Thanks for the fast reply!

6 hours ago, Tux said:

2) really maximum annoy system here, it's indeed because of the move of the ips function, I had thought I had taken care of this part but I have been too fast, it's a tricky part where you must be super careful or you do this kind of mistake. Super annoying, really !
It's a 1 line fix, but without this one you loose "play game" and "game options" in most games, I guess I'll have to release a quick fix binary because of this stupid line.

Ok, no problem with that. Maybe you could wait a little longer to fix some other things before releasing this quick fix version...

 

6 hours ago, Tux said:

3) still can't do, I even tested with the win version. I don't know which version I have, it's the original untouched with the bin files for audio tracks, I guess I decided to keep it this way because it's a rare format. Anyway : loading your state from the main menu of the game, pressing turbo until reaching the continue menu, pressing quit to title, pressing 1 so fast that you don't even see the white title appearing (tried also after the title has appeared), reaching the main menu, everything is normal and sound is working.

Thank you for testing this again and for your thorough report. You are totally correct in the procedure. I was very curious why you couldn't reproduce it there and went and tried with the original bin files (the ones without compression) and couldn't reproduce the issue with then. So I'm guessing it's something with my cue or with my compressed mp3 files. I'll link them below so you can try to crash the program there with them:

https://drive.google.com/file/d/1udVuiUUskTx2lBPHA-o4dwjZhd10Jpa7/view?usp=sharing

Just rename your original game file to the pattern in the cue and everything should be as exactly as I have here...

 

6 hours ago, Tux said:

4) very unlikely, it's related to the timers usually and when it happens it's baked into the save, I guess this save was done at a bad moment, but I can't guess which one. Raine has gone a long way to improve this kind of reliability when restoring sound, but there are obviously still cases where it's broken. I have taken the time to check the restoration of timers here, everything seems fine, so no idea what's going on. From the sound of it it sounds like something bad is looping, maybe a bad bank ? But the banks are supposed to be saved and restored here, so no idea. Anyway you seem to think it's an easy problem, it's not, it's a very complex one.

Ok, thank you for the thorough explanation. I'll see if I can find a point in the game where you can save a save state and reproduce this bug again.

Thank you so much again for your time.

Link to comment
Share on other sites

And it was again a bug which looked like nothing and was after all critical, this time a race condition on the sdl_sound sample when using this game this way. For some reason it didn't happen with the bin files, maybe because operations on these files are quicker. Anyway I had to move all the operations on this sample outside the callback, which is the opposite of what we did with sdl1... ! Normally it's safer this way, and your crash is finally gone.
I started by updating sdl_sound, but it was not the cause, I'll keep the sdl_sound update anyway (for flac, ogg and mp3).

Hoping that it didn't break anything else, I tested an sound association in kof97 and everything seems fine (uses the same method, an sdl_sound sample).

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...