~groovestomp/gsnes

dc345d3402b3daf4ca57826265ad381010ec2a78 — GrooveStomp 1 year, 5 months ago d128a3c
Fix bug in bg shifter calculations
2 files changed, 3 insertions(+), 3 deletions(-)

M main.c
M ppu.c
M main.c => main.c +1 -1
@@ 67,7 67,7 @@ void Deinit(int code) {
void Init() {
        char *ttf_filename = "/usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf";

        cart = CartInit("ice_climber.nes");
        cart = CartInit("nes_test.nes");
        if (NULL == cart) {
                fprintf(stderr, "Couldn't load cart");
                Deinit(1);

M ppu.c => ppu.c +2 -2
@@ 405,8 405,8 @@ void LoadBackgroundShifters(struct ppu *ppu) {
        // convenience, so here we take the bottom 2 bits of the attribute word
        // which represent which palette is being used for the current 8 pixels
        // and the next 8 pixels, and "inflate" them to 8 bit words.
        ppu->bgShifterAttribLo = (ppu->bgShifterAttribLo & 0xFF00) | (ppu->bgNextTileAttrib & 0x01) ? 0xFF : 0x00;
        ppu->bgShifterAttribHi = (ppu->bgShifterAttribHi & 0xFF00) | (ppu->bgNextTileAttrib & 0x02) ? 0xFF : 0x00;
        ppu->bgShifterAttribLo = (ppu->bgShifterAttribLo & 0xFF00) | ((ppu->bgNextTileAttrib & 0x01) ? 0xFF : 0x00);
        ppu->bgShifterAttribHi = (ppu->bgShifterAttribHi & 0xFF00) | ((ppu->bgNextTileAttrib & 0x02) ? 0xFF : 0x00);
}

void UpdateShifters(struct ppu *ppu) {