Skip to content
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

Screenshots not all taked from command line #37

Open
Narann opened this issue Sep 21, 2017 · 3 comments
Open

Screenshots not all taked from command line #37

Narann opened this issue Sep 21, 2017 · 3 comments
Labels

Comments

@Narann
Copy link
Member

Narann commented Sep 21, 2017

I realize, in some situation, every requested screenshots (argument --testshots) are not all generated.

I have a test suite that open a rom with a save state and save some screenshots. Generated command line looks like this:

./mupen64plus --resolution 640x480 --audio dummy --configdir ./ --nosaveoptions --testshots 2,5 --savestate mupen64plus-regression-test/save_state/1080sb-charselect.st0 --sshotdir mupen64plus-regression-test/screenshot /home/narann/code/repo/mupen64plus/mupen64plus-regression-test/rom/1080sb.z64

The second screenshot is never generated. Interestingly, I have around hundred tests and only 4-6 have this problem. It's not game related, maybe more save state related.

Looking at the code where the console ask for the screen shot:

https://github.com/mupen64plus/mupen64plus-ui-console/blob/master/src/main.c#L141

And how the core handle it:

https://github.com/mupen64plus/mupen64plus-core/blob/b9765eca453ed46773655c44bc86fbcdeb33ab7c/src/main/main.c#L725

As I understand the code, the core ask for a screenshot "next time" the video plugin reach video_plugin_render_callback. But the console ask for M64CMD_STOP as soon the last frame+1 is reached. This mean, the frame callback M64CMD_SET_FRAME_CALLBACK is executed before the video plugin reach video_plugin_render_callback and take its screenshot.

I will do some test to know if wait few frames after the latest screenshot before close the emulator could help...

@Narann Narann added the bug label Sep 21, 2017
@Narann
Copy link
Member Author

Narann commented Sep 21, 2017

I just tested 1 frame count in the callback (aka, wait one frame before ask the emulator to close) and it works!

However, I'm not sure it's the best thing to do... Any idea @richard42 ?

@richard42
Copy link
Member

Yeah, you could change line 145 to something like this:

else if (nextshot == 0 && FrameIndex == l_TestShotList[l_TestShotIdx-1] + 3)

@Narann
Copy link
Member Author

Narann commented Sep 22, 2017

Nice! I will do that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants