comparison vdp.c @ 2465:b0408f38f464

Add missing mask to vscroll calculation in Mode 4
author Michael Pavone <pavone@retrodev.com>
date Sat, 24 Feb 2024 11:53:44 -0800
parents dc05f1805921
children cf3e8a19aa25
comparison
equal deleted inserted replaced
2464:f9d5c137c74b 2465:b0408f38f464
1369 uint32_t address = (context->regs[REG_SCROLL_A] & 0xE) << 10; 1369 uint32_t address = (context->regs[REG_SCROLL_A] & 0xE) << 10;
1370 //add row 1370 //add row
1371 uint32_t vscroll = line; 1371 uint32_t vscroll = line;
1372 if (column < 24 || !(context->regs[REG_MODE_1] & BIT_VSCRL_LOCK)) { 1372 if (column < 24 || !(context->regs[REG_MODE_1] & BIT_VSCRL_LOCK)) {
1373 vscroll += context->regs[REG_Y_SCROLL]; 1373 vscroll += context->regs[REG_Y_SCROLL];
1374 vscroll &= 511;
1374 } 1375 }
1375 if (vscroll > 223) { 1376 if (vscroll > 223) {
1377 //TODO: support V28 and V30 for SMS2/GG VDPs
1376 vscroll -= 224; 1378 vscroll -= 224;
1377 } 1379 }
1378 address += (vscroll >> 3) * 2 * 32; 1380 address += (vscroll >> 3) * 2 * 32;
1379 //add column 1381 //add column
1380 address += ((column - (context->hscroll_a >> 3)) & 31) * 2; 1382 address += ((column - (context->hscroll_a >> 3)) & 31) * 2;