comparison blastem.c @ 357:fa7ea48be9a9

Allow VDP/PSG writes from Z80
author Mike Pavone <pavone@retrodev.com>
date Fri, 24 May 2013 00:26:27 -0700
parents 79e4b466e7d0
children 9498cfa7f7c8
comparison
equal deleted inserted replaced
356:79e4b466e7d0 357:fa7ea48be9a9
331 return context; 331 return context;
332 } 332 }
333 333
334 m68k_context * vdp_port_write_b(uint32_t vdp_port, m68k_context * context, uint8_t value) 334 m68k_context * vdp_port_write_b(uint32_t vdp_port, m68k_context * context, uint8_t value)
335 { 335 {
336 return vdp_port_write(vdp_port, context, vdp_port < 0x10 ? value | value << 8 : value); 336 return vdp_port_write(vdp_port, context, vdp_port < 0x10 ? value | value << 8 : ((vdp_port & 1) ? value : 0));
337 }
338
339 z80_context * z80_vdp_port_write(uint16_t vdp_port, z80_context * context, uint8_t value)
340 {
341 genesis_context * gen = context->system;
342 vdp_port_write_b(vdp_port, gen->m68k, value);
343 return context;
337 } 344 }
338 345
339 uint16_t vdp_port_read(uint32_t vdp_port, m68k_context * context) 346 uint16_t vdp_port_read(uint32_t vdp_port, m68k_context * context)
340 { 347 {
341 if (vdp_port & 0x2700E0) { 348 if (vdp_port & 0x2700E0) {