# HG changeset patch # User Michael Pavone # Date 1495256870 25200 # Node ID 6dd2c3edd0b5dc5243c92d084713ef96c6215b33 # Parent 30123ca5856ca99314afc0ddc05ebbb7a478a4fa Add a bit of a hack to HINT start cycle to give correct values in my test ROM and further improve prevelance of CRAM dot noise in Outrunners and OD2 diff -r 30123ca5856c -r 6dd2c3edd0b5 vdp.c --- a/vdp.c Fri May 19 20:54:04 2017 -0700 +++ b/vdp.c Fri May 19 22:07:50 2017 -0700 @@ -2086,7 +2086,7 @@ SPRITE_RENDER_H40(174) SPRITE_RENDER_H40(175) SPRITE_RENDER_H40(176) - SPRITE_RENDER_H40(177) + SPRITE_RENDER_H40(177)//End of border? SPRITE_RENDER_H40(178) SPRITE_RENDER_H40(179) SPRITE_RENDER_H40(180) @@ -3256,13 +3256,18 @@ return context->cycles + vdp_cycles_to_line(context, context->inactive_start); } +//This gives correct values in my test ROM. Kind of a hack, might be partly +//due to interrupts getting latched at the end of a "dbi" micro-instruction +//but that would only account for 28 of the 36 cycles. More hardware testing +//necessary to determine the cause of the discrepency +#define HINT_FUDGE 36 uint32_t vdp_next_hint(vdp_context * context) { if (!(context->regs[REG_MODE_1] & BIT_HINT_EN)) { return 0xFFFFFFFF; } if (context->flags2 & FLAG2_HINT_PENDING) { - return context->pending_hint_start; + return context->pending_hint_start - HINT_FUDGE; } uint32_t hint_line; if (context->state != ACTIVE) { @@ -3290,7 +3295,7 @@ } } } - return context->cycles + vdp_cycles_to_line(context, hint_line); + return context->cycles + vdp_cycles_to_line(context, hint_line) - HINT_FUDGE; } static uint32_t vdp_next_vint_real(vdp_context * context)