mamedev / mame

MAME
https://www.mamedev.org/
Other
8.27k stars 2.02k forks source link

Exception at EIP=00000000009dd638 (not found): ACCESS VIOLATION #5514

Closed Black-Jack-1978 closed 5 years ago

Black-Jack-1978 commented 5 years ago

Hi,

I'm trying to implement a new feature that let dump Palette\GFX\Tilemap from F4 Viewer. I've just downloaded the main branch, and built in Win7 64bit via:

make -j7 SOURCES=src\mame\drivers\dec0.cpp REGENIE=1

After an:

#include "png.h"

and "editing "viewgfx.cpp"'s "gfxset_handle_keys" method this way:

static void gfxset_handle_keys(running_machine &machine, ui_gfx_state &state, int xcells, int ycells)
{ 
    ....
        if (machine.ui_input().pressed(IPT_UI_PAUSE)){  
            emu_file file("snap", OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
            png_info pnginfo; 
            pnginfo.add_text("Software", "MAME 0.212 (unknown)");
            pnginfo.add_text("System", "bootleg Automat (bootleg of Robocop)");

            std::cout << "UI_GFX_GFXSET SELECTED!\n";
            std::string gfxCount = std::to_string(state.gfxset.devcount); 
            std::string gfxInfo("GFXSET->" + gfxCount + "\n");
            std::cout << gfxInfo.c_str();
            bitmap_rgb32 * bitmapGfx = state.bitmap;

            std::string bppCount = std::to_string( bitmapGfx->bpp());
            std::string bppInfo("BPPCOUNT->" + bppCount + "\n");
            std::cout << bppInfo.c_str();
            std::cout << "png_write_bitmap...\n";
            //video.cpp save_snapshot 322
            png_write_bitmap(file, &pnginfo, *bitmapGfx, 16, state.palette.interface->palette()->entry_list_adjusted()); //state.palette.interface->entry_list_raw() + gfx.colorbase() + color * gfx.granularity());
        }
}

I got:

[MINGW64] D:\test\mame-master>mame64 automat -debug
UI_GFX_GFXSET SELECTED!
GFXSET->1
BPPCOUNT->32
png_write_bitmap...
png_write_bitmap...started
write the PNG signature...started
write the rest of the PNG data...started
write_png_stream ...
error ...
png width----->144
write the IHDR chunk...
write the  pnginfo.width chunk...
write the pnginfo.height chunk...
write the bit_depth chunk...
write the color_type chunk...
write the compression_method chunk...
write the filter_method chunk...
write the interlace_method chunk...
write the PNG_CN_IHDR chunk...

-----------------------------------------------------
Exception at EIP=00000000009dd638 (not found): ACCESS VIOLATION
While attempting to read memory at 0000000000000000
-----------------------------------------------------
RAX=00000000a8a1ae0a RBX=0000000000000000 RCX=0000000000000000 RDX=0000000002db87e8
RSI=0000000002db87e8 RDI=000000000000000d RBP=00000000a8a1ae0a RSP=0000000002db87c0
 R8=0000000000000008  R9=0000000002016f20 R10=0000000000000000 R11=00000000000000b6
R12=0000000002db8890 R13=0000000000000010 R14=0000000000000000 R15=0000000002db88b0
-----------------------------------------------------
Stack crawl:
  0000000002db8810: 00000000009dd638 (not found)
  0000000002db8910: 00000000009e2f61 (not found)
  0000000002db8a20: 00000000009e385e (not found)
  0000000002db9270: 000000000052d3e9 (not found)
  0000000002db92b0: 000000000052dec8 (not found)
  0000000002db93a0: 000000000050fe04 (not found)
  0000000002db9420: 00000000009173f6 (not found)
  0000000002db94f0: 000000000089e104 (not found)
  0000000002dbf1d0: 00000000004d27b8 (not found)
  0000000002dbf440: 0000000000546287 (not found)
  0000000002dbf610: 00000000005465ed (not found)
  0000000002dbf670: 00000000004d0857 (not found)
  0000000002dbfe20: 0000000001eb05b7 (not found)
  0000000002dbfef0: 00000000004013a5 (not found)
  0000000002dbff20: 000000000040150b (not found)
  0000000002dbff50: 00007fff98a67bd4 (BaseThreadInitThunk+0x0014)
  0000000002dbffd0: 00007fff99d2ce71 (RtlUserThreadStart+0x0021)

Just can't figure out how to solve this. Can anybody give me an hint of what's wrong\going on here?

thanks!

cuavas commented 5 years ago

This is not the place to ask for programming help. Only reproducible issues with MAME should be reported. You can ask for help on an appropriate discussion forum.