Mercurial > repos > blastem
comparison vdp.c @ 1377:e587f16e7d3d
Implemented SMS pause button
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 28 May 2017 21:03:55 -0700 |
parents | 5b20840711c1 |
children | 71c8b97eb962 |
comparison
equal
deleted
inserted
replaced
1376:70d88d9bfe13 | 1377:e587f16e7d3d |
---|---|
1683 } | 1683 } |
1684 context->vcounter &= 0x1FF; | 1684 context->vcounter &= 0x1FF; |
1685 if (context->state == PREPARING) { | 1685 if (context->state == PREPARING) { |
1686 context->state = ACTIVE; | 1686 context->state = ACTIVE; |
1687 } | 1687 } |
1688 if (context->vcounter == 0x1FF) { | |
1689 context->flags2 &= ~FLAG2_PAUSE; | |
1690 } | |
1688 | 1691 |
1689 if (context->state != ACTIVE) { | 1692 if (context->state != ACTIVE) { |
1690 context->hint_counter = context->regs[REG_HINT]; | 1693 context->hint_counter = context->regs[REG_HINT]; |
1691 } else if (context->hint_counter) { | 1694 } else if (context->hint_counter) { |
1692 context->hint_counter--; | 1695 context->hint_counter--; |
3381 cycles_to_vint += (256 - LINE_CHANGE_MODE4 + VINT_SLOT_MODE4) * MCLKS_SLOT_H32; | 3384 cycles_to_vint += (256 - LINE_CHANGE_MODE4 + VINT_SLOT_MODE4) * MCLKS_SLOT_H32; |
3382 } | 3385 } |
3383 return context->cycles + cycles_to_vint; | 3386 return context->cycles + cycles_to_vint; |
3384 } | 3387 } |
3385 | 3388 |
3389 uint32_t vdp_next_nmi(vdp_context *context) | |
3390 { | |
3391 if (!(context->flags2 & FLAG2_PAUSE)) { | |
3392 return 0xFFFFFFFF; | |
3393 } | |
3394 return context->cycles + vdp_cycles_to_line(context, 0x1FF); | |
3395 } | |
3396 | |
3397 void vdp_pbc_pause(vdp_context *context) | |
3398 { | |
3399 context->flags2 |= FLAG2_PAUSE; | |
3400 } | |
3401 | |
3386 void vdp_int_ack(vdp_context * context) | 3402 void vdp_int_ack(vdp_context * context) |
3387 { | 3403 { |
3388 //CPU interrupt acknowledge is only used in Mode 5 | 3404 //CPU interrupt acknowledge is only used in Mode 5 |
3389 if (context->regs[REG_MODE_2] & BIT_MODE_5) { | 3405 if (context->regs[REG_MODE_2] & BIT_MODE_5) { |
3390 //Apparently the VDP interrupt controller is not very smart | 3406 //Apparently the VDP interrupt controller is not very smart |