Mercurial > repos > blastem
comparison vdp.c @ 708:61faa298af07
Small horizontal interrupt fixes
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 14 May 2015 23:17:55 -0700 |
parents | ce4046476abc |
children | 4cd8823f79e3 |
comparison
equal
deleted
inserted
replaced
707:8aa9aacefe12 | 708:61faa298af07 |
---|---|
1474 context->sprite_index = 0x80; | 1474 context->sprite_index = 0x80; |
1475 context->slot_counter = MAX_SPRITES_LINE_H32; | 1475 context->slot_counter = MAX_SPRITES_LINE_H32; |
1476 } | 1476 } |
1477 } | 1477 } |
1478 if (is_h40 && slot == LINE_CHANGE_H40 || !is_h40 && slot == LINE_CHANGE_H32) { | 1478 if (is_h40 && slot == LINE_CHANGE_H40 || !is_h40 && slot == LINE_CHANGE_H32) { |
1479 if (line >= inactive_start) { | 1479 if (line > inactive_start) { |
1480 context->hint_counter = context->regs[REG_HINT]; | 1480 context->hint_counter = context->regs[REG_HINT]; |
1481 } else if (context->hint_counter) { | 1481 } else if (context->hint_counter) { |
1482 context->hint_counter--; | 1482 context->hint_counter--; |
1483 } else { | 1483 } else { |
1484 context->flags2 |= FLAG2_HINT_PENDING; | 1484 context->flags2 |= FLAG2_HINT_PENDING; |
1952 if (context->flags2 & FLAG2_HINT_PENDING) { | 1952 if (context->flags2 & FLAG2_HINT_PENDING) { |
1953 return context->cycles; | 1953 return context->cycles; |
1954 } | 1954 } |
1955 uint32_t inactive_start = context->latched_mode & BIT_PAL ? PAL_INACTIVE_START : NTSC_INACTIVE_START; | 1955 uint32_t inactive_start = context->latched_mode & BIT_PAL ? PAL_INACTIVE_START : NTSC_INACTIVE_START; |
1956 uint32_t hint_line; | 1956 uint32_t hint_line; |
1957 if (context->vcounter >= inactive_start) { | 1957 if (context->vcounter + context->hint_counter >= inactive_start) { |
1958 hint_line = context->regs[REG_HINT]; | 1958 hint_line = context->regs[REG_HINT]; |
1959 } else { | 1959 } else { |
1960 hint_line = context->vcounter + context->hint_counter + 1; | 1960 hint_line = context->vcounter + context->hint_counter + 1; |
1961 } | 1961 } |
1962 | 1962 |