Previous 15994 Revisions Next

r15047 Saturday 28th April, 2012 at 02:49:51 UTC by Barry Rodewald
x68k: Fixed used of PCG H-DISP register. This fixes sprite/tilemap horizontal offset issues in Exciting Hour, Kyukyuoku Tiger, and Terra Cresta (and maybe others).
[src/mess/video]x68k.c

src/mess/video/x68k.c
r15046r15047
731731   switch(offset)
732732   {
733733   case 0x400:
734      state->m_bg0_8->set_scrollx(0,(data - state->m_crtc.hbegin) & 0x3ff);
735      state->m_bg0_16->set_scrollx(0,(data - state->m_crtc.hbegin) & 0x3ff);
734      state->m_bg0_8->set_scrollx(0,(data - state->m_crtc.hbegin + state->m_crtc.bg_hshift) & 0x3ff);
735      state->m_bg0_16->set_scrollx(0,(data - state->m_crtc.hbegin + state->m_crtc.bg_hshift) & 0x3ff);
736736      break;
737737   case 0x401:
738738      state->m_bg0_8->set_scrolly(0,(data - state->m_crtc.vbegin) & 0x3ff);
739739      state->m_bg0_16->set_scrolly(0,(data - state->m_crtc.vbegin) & 0x3ff);
740740      break;
741741   case 0x402:
742      state->m_bg1_8->set_scrollx(0,(data - state->m_crtc.hbegin) & 0x3ff);
743      state->m_bg1_16->set_scrollx(0,(data - state->m_crtc.hbegin) & 0x3ff);
742      state->m_bg1_8->set_scrollx(0,(data - state->m_crtc.hbegin + state->m_crtc.bg_hshift) & 0x3ff);
743      state->m_bg1_16->set_scrollx(0,(data - state->m_crtc.hbegin + state->m_crtc.bg_hshift) & 0x3ff);
744744      break;
745745   case 0x403:
746746      state->m_bg1_8->set_scrolly(0,(data - state->m_crtc.vbegin) & 0x3ff);
747747      state->m_bg1_16->set_scrolly(0,(data - state->m_crtc.vbegin) & 0x3ff);
748748      break;
749   case 0x405:  // BG H-DISP (like CRTC reg 2)
749   case 0x406:  // BG H-DISP (normally equals CRTC reg 2 value + 4)
750750      if(data != 0x00ff)
751751      {
752752         state->m_crtc.bg_visible_width = (state->m_crtc.reg[3] - ((data & 0x003f) - 4)) * 8;
753         state->m_crtc.bg_hshift = (state->m_crtc.width - state->m_crtc.bg_visible_width) / 2;
753         state->m_crtc.bg_hshift = ((data - (state->m_crtc.reg[2]+4)) * 8);
754754      }
755      else
756         state->m_crtc.bg_hshift = state->m_crtc.hshift;
757755      break;
758   case 0x406:  // BG V-DISP (like CRTC reg 6)
756   case 0x407:  // BG V-DISP (like CRTC reg 6)
759757      state->m_crtc.bg_vshift = state->m_crtc.vshift;
760758      break;
761759   }
r15046r15047
10341032         rect.max_x=rect.min_x + state->m_crtc.visible_width-1;
10351033         rect.max_y=rect.min_y + state->m_crtc.visible_height-1;
10361034
1035         sx += state->m_crtc.bg_hshift;
10371036         sx += state->m_sprite_shift;
10381037
10391038         if(state->m_crtc.interlace != 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team