# HG changeset patch # User Mike Pavone # Date 1368252966 25200 # Node ID 789f2f5f2277e330e7b0599908d9a4e5ab594eb9 # Parent e5e8b48ad1575ab9971e15910825eac212d85523 Implement hblank flag in status register diff -r e5e8b48ad157 -r 789f2f5f2277 vdp.c --- a/vdp.c Fri May 10 22:57:56 2013 -0700 +++ b/vdp.c Fri May 10 23:16:06 2013 -0700 @@ -1193,17 +1193,21 @@ if (context->flags2 & FLAG2_VINT_PENDING) { value |- 0x80; } + uint32_t line= context->cycles / MCLKS_LINE; + uint32_t linecyc = context->cycles % MCLKS_LINE; + if (line >= (context->latched_mode & BIT_PAL ? PAL_ACTIVE : NTSC_ACTIVE)) { + value |= 0x8; + } + if (linecyc < (context->latched_mode & BIT_H40 ? (148 + 61) * 4 : ( + 46) * 5)) { + value |= 0x4; + } if (context->flags & FLAG_DMA_RUN) { value |= 0x2; } - uint32_t line= context->cycles / MCLKS_LINE; - if (line >= (context->latched_mode & BIT_PAL ? PAL_ACTIVE : NTSC_ACTIVE)) { - value |= 0x8; - } if (context->latched_mode & BIT_PAL) {//Not sure about this, need to verify value |= 0x1; } - //TODO: Lots of other bits in status port + //TODO: Sprite overflow, sprite collision, odd frame flag return value; }