comparison vdp.c @ 2201:2f8984ff5c85

Prevent Mode 5 selection when not emulating the Genesis VDP
author Michael Pavone <pavone@retrodev.com>
date Mon, 22 Aug 2022 20:43:19 -0700
parents 6f66356af4e2
children dc4268a778bc
comparison
equal deleted inserted replaced
2200:f11f4399d64b 2201:2f8984ff5c85
3820 context->cd = (context->cd & 0x3C) | (value >> 14); 3820 context->cd = (context->cd & 0x3C) | (value >> 14);
3821 if (reg < (mode_5 ? VDP_REGS : 0xB)) { 3821 if (reg < (mode_5 ? VDP_REGS : 0xB)) {
3822 //printf("register %d set to %X\n", reg, value & 0xFF); 3822 //printf("register %d set to %X\n", reg, value & 0xFF);
3823 if (reg == REG_MODE_1 && (value & BIT_HVC_LATCH) && !(context->regs[reg] & BIT_HVC_LATCH)) { 3823 if (reg == REG_MODE_1 && (value & BIT_HVC_LATCH) && !(context->regs[reg] & BIT_HVC_LATCH)) {
3824 vdp_latch_hv(context); 3824 vdp_latch_hv(context);
3825 } 3825 } else if (reg == REG_BG_COLOR) {
3826 if (reg == REG_BG_COLOR) {
3827 value &= 0x3F; 3826 value &= 0x3F;
3827 } else if (reg == REG_MODE_2 && context->type != VDP_GENESIS) {
3828 // only the Genesis VDP does anything with this bit
3829 // so just clear it to prevent Mode 5 selection if we're not emulating that chip
3830 value &= ~BIT_MODE_5;
3828 } 3831 }
3829 /*if (reg == REG_MODE_4 && ((value ^ context->regs[reg]) & BIT_H40)) { 3832 /*if (reg == REG_MODE_4 && ((value ^ context->regs[reg]) & BIT_H40)) {
3830 printf("Mode changed from H%d to H%d @ %d, frame: %d\n", context->regs[reg] & BIT_H40 ? 40 : 32, value & BIT_H40 ? 40 : 32, context->cycles, context->frame); 3833 printf("Mode changed from H%d to H%d @ %d, frame: %d\n", context->regs[reg] & BIT_H40 ? 40 : 32, value & BIT_H40 ? 40 : 32, context->cycles, context->frame);
3831 }*/ 3834 }*/
3832 uint8_t buffer[2] = {reg, value}; 3835 uint8_t buffer[2] = {reg, value};