- [FIX] la capa Window es mostrava sempre

- [FIX] L'interrupció LYC=LY no funcionava correctament
- [FIX] els vectors de les interrupcions estaven mal: tots duien a l'interrupcio VBLANK
This commit is contained in:
2025-01-26 22:12:33 +01:00
parent 59feaf274f
commit 7f5760d826
2 changed files with 7 additions and 7 deletions

View File

@@ -176,7 +176,7 @@ namespace gbscreen
void fill_line_buffer_win(uint8_t LY)
{
const uint8_t LCDC = mem::readMem(0xff40);
if ((LCDC & 0x21) == 0) return;
if ((LCDC & 0x21) != 0x21) return;
const uint8_t WY = mem::readMem(0xff4a);
if (LY<WY) return;
const uint8_t WX = mem::readMem(0xff4b);
@@ -341,8 +341,8 @@ namespace gbscreen
}
if (LY==LYC)
{
STAT = (STAT & 0xFB) | 0x40;
if (STAT&0x04) stat_interrupt = true;
STAT = (STAT & 0xFB) | 0x04;
if (STAT&0x40) stat_interrupt = true;
}
else
{

View File

@@ -483,16 +483,16 @@ namespace sm83
rPC = 0x40;
mem::writeMem(0xff0f, IF & ~INTERRUPT_VBLANK);
} else if (IF & INTERRUPT_LCD) {
rPC = 0x40;
rPC = 0x48;
mem::writeMem(0xff0f, IF & ~INTERRUPT_LCD);
} else if (IF & INTERRUPT_TIMER) {
rPC = 0x40;
rPC = 0x50;
mem::writeMem(0xff0f, IF & ~INTERRUPT_TIMER);
} else if (IF & INTERRUPT_SERIAL) {
rPC = 0x40;
rPC = 0x58;
mem::writeMem(0xff0f, IF & ~INTERRUPT_SERIAL);
} else if (IF & INTERRUPT_JOYPAD) {
rPC = 0x40;
rPC = 0x60;
mem::writeMem(0xff0f, IF & ~INTERRUPT_JOYPAD);
}
/*if (options[Z80_OPTION_BREAK_ON_INTERRUPT]) {