gameboy icon indicating copy to clipboard operation
gameboy copied to clipboard

Slightly odd rendering on a Mac

Open ukd1 opened this issue 2 years ago • 2 comments

I'm learning GB dev, and some simple sprite swapping code is not rendering out as expected using this emulator (release built on an M1 Mac from bc90e61fa2de41fccd687a0ed98a8346066875f9), but is with others.

For example with gameboy vs rboy: problem

I've attached the rom, and the code as it's simple. I am building it with @gbdk-2020.

#include <gb/gb.h>

const unsigned char face[] =
{
  0x7E,0x7E,0x81,0x81,0xA5,0xA5,0x81,0x81,
  0xA5,0xA5,0x99,0x99,0x81,0x81,0x7E,0x7E,
  0x7E,0x7E,0x81,0x81,0xA5,0xA5,0x81,0x81,
  0x81,0x81,0xBD,0xBD,0x81,0x81,0x7E,0x7E
};


void main(void) {
    UINT8 current_sprite = 0;
    set_sprite_data(0, 2, face);
    set_sprite_tile(0, 0);
    move_sprite(0, 88, 78);
    SHOW_SPRITES;

    while(1) {
        if (current_sprite == 0) {
            current_sprite = 1;
        } else {
            current_sprite = 0;
        }
        delay(1000);
        set_sprite_tile(0, current_sprite);
    }
}

Anyway, thanks for the effort on this project! 🙇🏻

ukd1 avatar Mar 03 '23 19:03 ukd1

I'm guessing there's a bug somewhere, but I don't know how to start right now. I'll try to analyze it, thanks for the report.

mohanson avatar Mar 06 '23 01:03 mohanson

Of course, hopefully it's detailed enough to help find it.

ukd1 avatar Mar 06 '23 16:03 ukd1