[AD] blit() ALLEGRO_NO_ASM crash

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


The attached program crashes in the call to blit() when linked to a version of Allegro compiled with ALLEGRO_USE_C defined.

I'm using Allegro SVN HEAD and MinGW GCC 3.4.5, and compiled the lib using

make STATICLINK=1 ALLEGRO_USE_C=1 TARGET_ARCH_EXCL=i586 all

If I compile a statically linked version using the assembler code, I get no crash.

GDB says:

Program received signal SIGSEGV, Segmentation fault.
0x004576f6 in gfx_directx_write_bank_win ()
(gdb) bt
#0  0x004576f6 in gfx_directx_write_bank_win ()
#1  0x0048e050 in __linear_vtable32 ()
#2  0x0046dedf in _linear_blit32 (src=0x3d98a8, dst=0x3d8c40, sx=0, sy=0,
    dx=0, dy=0, w=800, h=600) at src/c/cblit.h:81
#3  0x0040a6a1 in blit (src=0x3d98a8, dest=0x3d8c40, s_x=0, s_y=0, d_x=0,
    d_y=0, w=800, h=600) at src/blit.c:723
#4  0x004014cd in _mangled_main() ()
#5  0x00402911 in _WinMain (_main=0x4012e0, hInst=0x400000, hPrev=0x0,
    Cmd=0x241eff "", nShow=10) at src/win/wsystem.c:537
#6  0x00401542 in WinMain@xxxxxxxxxx ()
#7  0x00489f8a in main ()

--
Daniel Schlyder
#include <allegro.h>
#include <assert.h>



int main()
{
    BITMAP *dblbuf;
    
    assert(allegro_init() == 0);
    assert(install_keyboard() >= 0);
    
    set_color_depth(32);
    assert(set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0) == 0);
    
    dblbuf = create_bitmap(SCREEN_W, SCREEN_H);
    assert(dblbuf);
    clear_to_color(dblbuf, makecol(255, 255, 255));

    while (!keypressed())
    {
        blit(dblbuf, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); // crashes
        rest(1);
    }
    
    destroy_bitmap(dblbuf);
    
    return 0;
}
END_OF_MAIN()


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/