g++ avr8.cpp -o uzem -lSDL -I/usr/include/SDL -ggdb
when I try to run it ( ./uzem ../demos/Megatris/default/Megatris.hex ) it crashes with a SegFault.
I have run it through gdb and discovered that the crash was happening at the line 2002, where the pixels are drawn in the line buffers. It seems that there might be illegal access to data beyond the buffer limits (probably at the end of the frame).
Looking at the code I noticed that fullscreen has a black border. Which means that maybe these wrong accesses would fall within this border if I run the emulator in fullscreen. Then, indeed it worked when opened with -fulscreen flag. But the graphics where wrong. Look at this screenshot:

then I have edited these 2 lines so that they now shift 2 bits instead of only one:
- Code: Select all
current_scanline[current_cycle>>2] = pixel;
next_scanline[current_cycle>>2] = pixel;
and now it works nice. But it still crashes in windowed mode...
