Previous 15994 Revisions Next

r15067 Monday 30th April, 2012 at 06:47:59 UTC by Barry Rodewald
amstrad: Put CRTC and palette writes behind a short timer. This fixes video timing glitches in numerous games.
[src/mess/machine]amstrad.c

src/mess/machine/amstrad.c
r15066r15067
577577      amstrad_plus_dma_parse( machine, 2 );
578578}
579579
580static TIMER_CALLBACK(amstrad_video_update_timer)
581{
582   if(param == 1)
583      amstrad_plus_update_video(machine);
584   else
585      amstrad_update_video(machine);
586}
580587
581588/* Set the new colour from the GateArray */
582589static void amstrad_vh_update_colour(running_machine &machine, int PenIndex, UINT16 hw_colour_index)
r15066r15067
586593   {
587594      int val;
588595
589      amstrad_plus_update_video( machine );
596      machine.scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),1);
590597
591598      /* CPC+/GX4000 - normal palette changes through the Gate Array also makes the corresponding change in the ASIC palette */
592599      val = (amstrad_palette[hw_colour_index] & 0xf00000) >> 16; /* red */
r15066r15067
597604   }
598605   else
599606   {
600      amstrad_update_video( machine );
607      machine.scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),0);
601608   }
602609   state->m_GateArray_render_colours[PenIndex] = hw_colour_index;
603610}
r15066r15067
606613static void aleste_vh_update_colour(running_machine &machine, int PenIndex, UINT16 hw_colour_index)
607614{
608615   amstrad_state *state = machine.driver_data<amstrad_state>();
609   amstrad_update_video( machine );
616   machine.scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),0);
610617   state->m_GateArray_render_colours[PenIndex] = hw_colour_index+32;
611618}
612619
r15066r15067
630637   amstrad_state *state = machine.driver_data<amstrad_state>();
631638   attotime now = machine.time();
632639
640
633641   if ( state->m_gate_array.draw_p )
634642   {
635643      UINT32 cycles_passed = (now - state->m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz);
r15066r15067
19621970   m_prev_data = data;
19631971}
19641972
1965
19661973/* Offset handler for write */
19671974WRITE8_MEMBER(amstrad_state::amstrad_cpc_io_w)
19681975{
r15066r15067
20062013         break;
20072014      case 0x01:      /* Write to selected internal 6845 register Write Only */
20082015         if ( m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000 )
2009            amstrad_plus_update_video(machine());
2016            machine().scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),1);
20102017         else
2011            amstrad_update_video(machine());
2018            machine().scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),0);
20122019         mc6845->register_w( space, 0, data );
20132020
20142021         /* printer port bit 8 */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team