Mercurial > repos > blastem
comparison vdp.c @ 1994:00873afe1fe9
Fix regressions in Monster World IV and Sonic 3D Blast caused by address latch changes
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 18 Jun 2020 00:20:25 -0700 |
parents | 6b9871d3d70d |
children | e08c489d5602 |
comparison
equal
deleted
inserted
replaced
1992:8ad431312aa7 | 1994:00873afe1fe9 |
---|---|
3748 //printf("DMA Fill Address: %X, New CD: %X\n", context->address, context->cd); | 3748 //printf("DMA Fill Address: %X, New CD: %X\n", context->address, context->cd); |
3749 } | 3749 } |
3750 } | 3750 } |
3751 } else { | 3751 } else { |
3752 uint8_t mode_5 = context->regs[REG_MODE_2] & BIT_MODE_5; | 3752 uint8_t mode_5 = context->regs[REG_MODE_2] & BIT_MODE_5; |
3753 //contrary to what's in Charles MacDonald's doc, it seems top 2 address bits are cleared | |
3754 //needed for the Mona in 344 Bytes demo | |
3755 context->address_latch = (context->address_latch & 0x1C000) | (value & 0x3FFF); | 3753 context->address_latch = (context->address_latch & 0x1C000) | (value & 0x3FFF); |
3756 context->cd_latch = (context->cd_latch & 0x3C) | (value >> 14); | 3754 context->cd_latch = (context->cd_latch & 0x3C) | (value >> 14); |
3757 if ((value & 0xC000) == 0x8000) { | 3755 if ((value & 0xC000) == 0x8000) { |
3758 //Register write | 3756 //Register write |
3759 uint8_t reg = (value >> 8) & 0x1F; | 3757 uint8_t reg = (value >> 8) & 0x1F; |
3779 } | 3777 } |
3780 if (reg == REG_MODE_1 || reg == REG_MODE_2 || reg == REG_MODE_4) { | 3778 if (reg == REG_MODE_1 || reg == REG_MODE_2 || reg == REG_MODE_4) { |
3781 update_video_params(context); | 3779 update_video_params(context); |
3782 } | 3780 } |
3783 } | 3781 } |
3782 // The fact that this is needed seems to pour some cold water on my theory | |
3783 // about how the address latch actually works. Needs more search to definitively confirm | |
3784 clear_pending(context); | |
3785 context->flags &= ~FLAG_READ_FETCHED; | |
3786 context->flags2 &= ~FLAG2_READ_PENDING; | |
3784 } else if (mode_5) { | 3787 } else if (mode_5) { |
3785 context->flags |= FLAG_PENDING; | 3788 context->flags |= FLAG_PENDING; |
3786 //Should these be taken care of here or after the second write? | 3789 //Should these be taken care of here or after the second write? |
3787 //context->flags &= ~FLAG_READ_FETCHED; | 3790 //context->flags &= ~FLAG_READ_FETCHED; |
3788 //context->flags2 &= ~FLAG2_READ_PENDING; | 3791 //context->flags2 &= ~FLAG2_READ_PENDING; |