Mercurial > repos > blastem
comparison vdp.c @ 318:789f2f5f2277
Implement hblank flag in status register
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 10 May 2013 23:16:06 -0700 |
parents | e5e8b48ad157 |
children | 8e2fa485c0f2 |
comparison
equal
deleted
inserted
replaced
317:e5e8b48ad157 | 318:789f2f5f2277 |
---|---|
1191 value |= 0x100; | 1191 value |= 0x100; |
1192 } | 1192 } |
1193 if (context->flags2 & FLAG2_VINT_PENDING) { | 1193 if (context->flags2 & FLAG2_VINT_PENDING) { |
1194 value |- 0x80; | 1194 value |- 0x80; |
1195 } | 1195 } |
1196 uint32_t line= context->cycles / MCLKS_LINE; | |
1197 uint32_t linecyc = context->cycles % MCLKS_LINE; | |
1198 if (line >= (context->latched_mode & BIT_PAL ? PAL_ACTIVE : NTSC_ACTIVE)) { | |
1199 value |= 0x8; | |
1200 } | |
1201 if (linecyc < (context->latched_mode & BIT_H40 ? (148 + 61) * 4 : ( + 46) * 5)) { | |
1202 value |= 0x4; | |
1203 } | |
1196 if (context->flags & FLAG_DMA_RUN) { | 1204 if (context->flags & FLAG_DMA_RUN) { |
1197 value |= 0x2; | 1205 value |= 0x2; |
1198 } | 1206 } |
1199 uint32_t line= context->cycles / MCLKS_LINE; | |
1200 if (line >= (context->latched_mode & BIT_PAL ? PAL_ACTIVE : NTSC_ACTIVE)) { | |
1201 value |= 0x8; | |
1202 } | |
1203 if (context->latched_mode & BIT_PAL) {//Not sure about this, need to verify | 1207 if (context->latched_mode & BIT_PAL) {//Not sure about this, need to verify |
1204 value |= 0x1; | 1208 value |= 0x1; |
1205 } | 1209 } |
1206 //TODO: Lots of other bits in status port | 1210 //TODO: Sprite overflow, sprite collision, odd frame flag |
1207 return value; | 1211 return value; |
1208 } | 1212 } |
1209 | 1213 |
1210 uint16_t vdp_data_port_read(vdp_context * context) | 1214 uint16_t vdp_data_port_read(vdp_context * context) |
1211 { | 1215 { |