comparison vdp.c @ 1152:ddbb61be6119

Fix to pass a couple more tests in VDPTEST.sms
author Michael Pavone <pavone@retrodev.com>
date Wed, 04 Jan 2017 23:01:58 -0800
parents 681e8a13b261
children 2e3ad914bad3
comparison
equal deleted inserted replaced
1151:681e8a13b261 1152:ddbb61be6119
2175 } 2175 }
2176 } 2176 }
2177 } else { 2177 } else {
2178 uint8_t mode_5 = context->regs[REG_MODE_2] & BIT_MODE_5; 2178 uint8_t mode_5 = context->regs[REG_MODE_2] & BIT_MODE_5;
2179 context->address = (context->address &0xC000) | (value & 0x3FFF); 2179 context->address = (context->address &0xC000) | (value & 0x3FFF);
2180 //Genesis Plus GX doesn't clear out the mode bits in Mode 4, but instead 2180 //Genesis Plus GX doesn't clear out the upper mode bits in Mode 4, but instead
2181 //ignores the uppper mode bits when it comes to reads/writes 2181 //ignores the uppper mode bits when it comes to reads/writes
2182 //testing on hardware is needed to determine which is truly correct 2182 //testing on hardware is needed to determine which is truly correct
2183 context->cd = (mode_5 ? context->cd &0x3C : 0) | (value >> 14); 2183 context->cd = (mode_5 ? context->cd &0x3C : 0) | (value >> 14);
2184 if ((value & 0xC000) == 0x8000) { 2184 if ((value & 0xC000) == 0x8000) {
2185 //Register write 2185 //Register write
2386 if (context->flags & FLAG_READ_FETCHED) { 2386 if (context->flags & FLAG_READ_FETCHED) {
2387 context->flags &= ~FLAG_READ_FETCHED; 2387 context->flags &= ~FLAG_READ_FETCHED;
2388 //Should this happen after the prefetch or after the read? 2388 //Should this happen after the prefetch or after the read?
2389 increment_address(context); 2389 increment_address(context);
2390 } 2390 }
2391 context->cd &= ~1; 2391 context->cd = VRAM_READ8;
2392 if (context->cd == VRAM_READ) {
2393 context->cd = VRAM_READ8;
2394 }
2395 return context->prefetch; 2392 return context->prefetch;
2396 } 2393 }
2397 2394
2398 uint16_t vdp_hv_counter_read(vdp_context * context) 2395 uint16_t vdp_hv_counter_read(vdp_context * context)
2399 { 2396 {