Page 1 of 1

[FIXED]PNG screenshotting

Posted: Wed Apr 16, 2008 6:38 am
by Hard Core Rikki
  • svn 478 (probably not exclusive to this revision)
  • fresh ini
  • additional files in the root folder:

d3dx9_36.dll

d3dx9_37.dll

libpng13.dll

zlib1.dll

 

 

If the screenshot format is png, screenshotting crashes the emulator every time, whether triggered by the screenshot command in the menu or the keyboard shortcut. screenies not written (black 0 byte files) and not readable.

 

When BMP is selected instead, screenshotting works fine.


[FIXED]PNG screenshotting

Posted: Wed Apr 16, 2008 8:09 am
by spacy51

The debug version crashes as well. The code causing libpng13.dll to fail is located in Util.cpp at line 109 ("png_write_info(png_ptr,info_ptr);")

 

There were no changes recently, but the png-lib has been updated several times, so there were possibly some slight API changes.

I haven't worked with libpng until now, so help is appreciated.


[FIXED]PNG screenshotting

Posted: Wed Apr 16, 2008 8:24 pm
by Hard Core Rikki

png_write_info(png_ptr,info_ptr);

 

I believe one of these would be correct.

png_write_info(png_ptr, ptr_info);

png_write_info(png_ptr, png_info);


[FIXED]PNG screenshotting

Posted: Thu Apr 17, 2008 7:19 pm
by mudlord

"There were no changes recently, but the png-lib has been updated several times, so there were possibly some slight API changes."

 

Main question I have to ask is are you using the latest libpng version?


[FIXED]PNG screenshotting

Posted: Fri Apr 18, 2008 1:10 am
by Squall Leonhart

I already reported this on sourceforge, it only occured when hitting the screenshot key, at first, and could be worked around by hitting pause first.

 

but now it is doing it via the menu as well. it seems to be something to do with it continuing play after having taken the screenshot, as the sound returns again for about a second.

 

https://sourceforge.net/tracker/index.php?func=detail&aid=1928413&group_id=212795&atid=1023154


[FIXED]PNG screenshotting

Posted: Fri Apr 18, 2008 9:19 am
by spacy51

"There were no changes recently, but the png-lib has been updated several times, so there were possibly some slight API changes."

 

Main question I have to ask is are you using the latest libpng version?

 

 

I am currently using libpng 1.2.25 (x86), built from the official project files with the official source package.

 

There is already a newer version 1.2.26, but I don't think this bug is libpng-related.


[FIXED]PNG screenshotting

Posted: Sun May 04, 2008 12:40 pm
by spacy51

This one is really a hard nut to crack. I already made the png initialization look like in the official tutorial and still get that error. I will continue to work on it, though. Just built me some debug libpng & zlib.

 

EDIT:

I'm now using libpng 1.2.28, debug build.

 

This bug gets stranger and stranger.

Libpng crashes when trying to write the 8-bit signature ("...PNG...") at the beginning of the file:

 

pngwio.c:

Line 54: check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));

 

[values:

data = 0x0012ec88 "‰PNGÌÌÌÌH\Έí"

lenght = 8

png_ptr->io_ptr = 0x00adeb70

]

 

 

fwrite() crashes here:

fwrite.c (MS C-Runtime):

Line 79: _lock_str(stream); /* lock stream */

 

Finally, lock_file crashes at "EnterCriticalSection( &(((FILEX *)pf)->lock) );"

 

 

Someone help me [img]<fileStore.core_Emoticons>/emoticons/huh.png[/img]/emoticons/huh@2x.png 2x" width="20" height="20" />

 

 

EDIT2:

I just found someone having the exact same problem: http://www.mail-archive.com/gnuwin32-users@lists.sourceforge.net/msg00657.html

 

His solution:

"The solution is relatively simple: just be sure that the project in which you

are using LibPng is compiled with the same "Runtime Library" settings. I think

that by default the lib is compiled in "/MD" (multi-threaded DLL) and a lot

of projects are single threaded by default. This setting can be found in the

project's property under C++/Code Generation (in VC7.1)."

 

Now, this would be an easy fix, but I already have the same runtime (Multi-Threaded Release/Debug) for zlib/libpng & VBA-M.

 

Maybe only a static link to libpng as it was default for the MSVC2005 builds will help???

 

 

EDIT3:

Of course this bug occurs on all builds from the http://vba-m.com/vbam/vbacompiles/msvc2008/ dir (SVN451 and up). http://vba-m.com/vbam/vbacompiles/VisualBoyAdvance368.rar was the last version working, since it was compiled with MSVC2005 which still has the static link to libpng & zlib. Welcome to DLL hell.


[FIXED]PNG screenshotting

Posted: Sun May 04, 2008 9:12 pm
by mudlord

Heh.

 

In that case, make libpng static. Removes the issue of dependancy hell.


[FIXED]PNG screenshotting

Posted: Mon May 05, 2008 8:19 am
by spacy51

yup, I will