fixed lyc interrupt when lyc = 0
This commit is contained in:
parent
c8ec44fa39
commit
2ab09f9b4c
@ -59,11 +59,11 @@ void lcd_write(u16 address, u8 value) {
|
|||||||
p[offset] = value;
|
p[offset] = value;
|
||||||
|
|
||||||
if(offset == 2) {
|
if(offset == 2) {
|
||||||
printf("YScroll: %02X\n", value);
|
//printf("YScroll: %02X\n", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(offset == 0xA) {
|
if(offset == 0xA) {
|
||||||
printf("WinY: %02X\n", value);
|
//printf("WinY: %02X\n", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(offset == 6) {
|
if(offset == 6) {
|
||||||
|
@ -17,7 +17,6 @@ void increment_ly() {
|
|||||||
|
|
||||||
if(lcd_get_context()->ly == lcd_get_context()->ly_compare) {
|
if(lcd_get_context()->ly == lcd_get_context()->ly_compare) {
|
||||||
LCDS_LYC_SET(1);
|
LCDS_LYC_SET(1);
|
||||||
|
|
||||||
if(LCDS_STAT_INT(SS_LYC)) {
|
if(LCDS_STAT_INT(SS_LYC)) {
|
||||||
cpu_request_interrupt(IT_LCD_STAT);
|
cpu_request_interrupt(IT_LCD_STAT);
|
||||||
}
|
}
|
||||||
@ -128,6 +127,14 @@ void ppu_mode_vblank() {
|
|||||||
cpu_request_interrupt(IT_LCD_STAT);
|
cpu_request_interrupt(IT_LCD_STAT);
|
||||||
}
|
}
|
||||||
lcd_get_context()->ly = 0;
|
lcd_get_context()->ly = 0;
|
||||||
|
if(lcd_get_context()->ly == lcd_get_context()->ly_compare) {
|
||||||
|
LCDS_LYC_SET(1);
|
||||||
|
if(LCDS_STAT_INT(SS_LYC)) {
|
||||||
|
cpu_request_interrupt(IT_LCD_STAT);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LCDS_LYC_SET(0);
|
||||||
|
}
|
||||||
ppu_get_context()->window_line = 0;
|
ppu_get_context()->window_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user