diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-05-19 22:07:50 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-05-19 22:07:50 -0700 |
commit | 50e7961c813f3663f7688a47c47491e9ed9dea00 (patch) | |
tree | 879683d811b88e733afa7d27d54fdb868bcb875b /vdp.c | |
parent | ee51509e7a71a60c8012e4c6d0bd7de2d5016bf8 (diff) |
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
Diffstat (limited to 'vdp.c')
-rw-r--r-- | vdp.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -2086,7 +2086,7 @@ static void vdp_h40(vdp_context * context, uint32_t target_cycles) 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 @@ uint32_t vdp_cycles_to_frame_end(vdp_context * context) 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 @@ uint32_t vdp_next_hint(vdp_context * context) } } } - 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) |