Previous 15994 Revisions Next

r15217 Friday 18th May, 2012 at 07:07:41 UTC by Barry Rodewald
fmtowns: Fixed sprite clipping regression in a few games, and made expanded I/O access to CMOS (no whatsnew)
[src/mess/drivers]fmtowns.c
[src/mess/video]fmtowns.c

src/mess/video/fmtowns.c
r15216r15217
691691   UINT16 xstart,xend,ystart,yend;
692692   int xdir,ydir;
693693   int width = (state->m_video.towns_crtc_reg[12] - state->m_video.towns_crtc_reg[11]) / (((state->m_video.towns_crtc_reg[27] & 0x0f00) >> 8)+1);
694   int height = (state->m_video.towns_crtc_reg[16] - state->m_video.towns_crtc_reg[15]) / (((state->m_video.towns_crtc_reg[27] & 0xf000) >> 12)+1);
694   int height = (state->m_video.towns_crtc_reg[16] - state->m_video.towns_crtc_reg[15]) / (((state->m_video.towns_crtc_reg[27] & 0xf000) >> 12)+2);
695695
696696   if(xflip)
697697   {
r15216r15217
735735         col = state->m_towns_txtvram[coffset+(pixel*2)] | (state->m_towns_txtvram[coffset+(pixel*2)+1] << 8);
736736         voffset += (state->m_video.towns_crtc_reg[24] * 4) * (ypos & 0x1ff);  // scanline size in bytes * y pos
737737         voffset += (xpos & 0x1ff) * 2;
738         voffset &= 0x3ffff;
739         if(xpos < width && ypos < height && pixel != 0)
738         if((state->m_video.towns_sprite_page != 0 && voffset > 0x1ffff && voffset < 0x40000)
739               || (state->m_video.towns_sprite_page == 0 && voffset < 0x20000))
740740         {
741            state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8;
742            state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff;
741            if(xpos < width && ypos < height && pixel != 0)
742            {
743               state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8;
744               state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff;
745            }
743746         }
744747         if(xflip)
745748            voffset+=2;
r15216r15217
747750            voffset-=2;
748751         pixel = state->m_towns_txtvram[poffset] & 0x0f;
749752         col = state->m_towns_txtvram[coffset+(pixel*2)] | (state->m_towns_txtvram[coffset+(pixel*2)+1] << 8);
750         voffset &= 0x3ffff;
751         if(xpos < width && ypos < height && pixel != 0)
753         if((state->m_video.towns_sprite_page != 0 && voffset > 0x1ffff && voffset < 0x40000)
754               || (state->m_video.towns_sprite_page == 0 && voffset < 0x20000))
752755         {
753            state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8;
754            state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff;
756            if(xpos < width && ypos < height && pixel != 0)
757            {
758               state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8;
759               state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff;
760            }
755761         }
756762         poffset++;
757763         poffset &= 0x1ffff;
r15216r15217
768774   UINT16 xstart,ystart,xend,yend;
769775   int xdir,ydir;
770776   int width = (state->m_video.towns_crtc_reg[12] - state->m_video.towns_crtc_reg[11]) / (((state->m_video.towns_crtc_reg[27] & 0x0f00) >> 8)+1);
771   int height = (state->m_video.towns_crtc_reg[16] - state->m_video.towns_crtc_reg[15]) / (((state->m_video.towns_crtc_reg[27] & 0xf000) >> 12)+1);
777   int height = (state->m_video.towns_crtc_reg[16] - state->m_video.towns_crtc_reg[15]) / (((state->m_video.towns_crtc_reg[27] & 0xf000) >> 12)+2);
772778
773779   if(xflip)
774780   {
r15216r15217
811817         col = state->m_towns_txtvram[poffset] | (state->m_towns_txtvram[poffset+1] << 8);
812818         voffset += (state->m_video.towns_crtc_reg[24] * 4) * (ypos & 0x1ff);  // scanline size in bytes * y pos
813819         voffset += (xpos & 0x1ff) * 2;
814         voffset &= 0x3ffff;
815         if(xpos < width && ypos < height && col < 0x8000)
820         if((state->m_video.towns_sprite_page != 0 && voffset > 0x1ffff && voffset < 0x40000)
821               || (state->m_video.towns_sprite_page == 0 && voffset < 0x20000))
816822         {
817            state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8;
818            state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff;
823            if(xpos < width && ypos < height && col < 0x8000)
824            {
825               state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8;
826               state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff;
827            }
819828         }
820829         poffset+=2;
821830         poffset &= 0x1ffff;
r15216r15217
18431852
18441853#ifdef CRTC_REG_DISP
18451854   popmessage("CRTC: %i %i %i %i %i %i %i %i %i\n%i %i %i %i | %i %i %i %i\n%04x %i %i %i | %04x %i %i %i\nZOOM: %04x\nVideo: %02x %02x\nText=%i Spr=%02x\nReg28=%04x",
1846      state->m_video.towns_crtc_reg[0],state->m_video.towns_crtc_reg[1],state->m_video.towns_crtc_reg[2],state->m_video.towns_crtc_reg[3],
1847      state->m_video.towns_crtc_reg[4],state->m_video.towns_crtc_reg[5],state->m_video.towns_crtc_reg[6],state->m_video.towns_crtc_reg[7],
1848      state->m_video.towns_crtc_reg[8],
1849      state->m_video.towns_crtc_reg[9],state->m_video.towns_crtc_reg[10],state->m_video.towns_crtc_reg[11],state->m_video.towns_crtc_reg[12],
1850      state->m_video.towns_crtc_reg[13],state->m_video.towns_crtc_reg[14],state->m_video.towns_crtc_reg[15],state->m_video.towns_crtc_reg[16],
1851      state->m_video.towns_crtc_reg[17],state->m_video.towns_crtc_reg[18],state->m_video.towns_crtc_reg[19],state->m_video.towns_crtc_reg[20],
1852      state->m_video.towns_crtc_reg[21],state->m_video.towns_crtc_reg[22],state->m_video.towns_crtc_reg[23],state->m_video.towns_crtc_reg[24],
1853      state->m_video.towns_crtc_reg[27],state->m_video.towns_video_reg[0],state->m_video.towns_video_reg[1],state->m_video.towns_tvram_enable,state->m_video.towns_sprite_reg[1] & 0x80,
1854      state->m_video.towns_crtc_reg[28]);
1855      m_video.towns_crtc_reg[0],m_video.towns_crtc_reg[1],m_video.towns_crtc_reg[2],m_video.towns_crtc_reg[3],
1856      m_video.towns_crtc_reg[4],m_video.towns_crtc_reg[5],m_video.towns_crtc_reg[6],m_video.towns_crtc_reg[7],
1857      m_video.towns_crtc_reg[8],
1858      m_video.towns_crtc_reg[9],m_video.towns_crtc_reg[10],m_video.towns_crtc_reg[11],m_video.towns_crtc_reg[12],
1859      m_video.towns_crtc_reg[13],m_video.towns_crtc_reg[14],m_video.towns_crtc_reg[15],m_video.towns_crtc_reg[16],
1860      m_video.towns_crtc_reg[17],m_video.towns_crtc_reg[18],m_video.towns_crtc_reg[19],m_video.towns_crtc_reg[20],
1861      m_video.towns_crtc_reg[21],m_video.towns_crtc_reg[22],m_video.towns_crtc_reg[23],m_video.towns_crtc_reg[24],
1862      m_video.towns_crtc_reg[27],m_video.towns_video_reg[0],m_video.towns_video_reg[1],m_video.towns_tvram_enable,m_video.towns_sprite_reg[1] & 0x80,
1863      m_video.towns_crtc_reg[28]);
18551864#endif
18561865
18571866   return 0;
src/mess/drivers/fmtowns.c
r15216r15217
21722172  // SCSI controller
21732173  AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("scsi",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff00ff)
21742174  // CMOS
2175  AM_RANGE(0x3000,0x3fff) AM_READWRITE8(towns_cmos_r, towns_cmos_w,0x00ff00ff)
2175  AM_RANGE(0x3000,0x4fff) AM_READWRITE8(towns_cmos_r, towns_cmos_w,0x00ff00ff)
21762176  // Something (MS-DOS wants this 0x41ff to be 1)
2177//  AM_RANGE(0x41fc,0x41ff) AM_READ8(towns_41ff_r,0xff000000)
2177  //AM_RANGE(0x41fc,0x41ff) AM_READ8(towns_41ff_r,0xff000000)
21782178  // CRTC / Video (again)
21792179  AM_RANGE(0xfd90,0xfda3) AM_READWRITE8(towns_video_fd90_r, towns_video_fd90_w, 0xffffffff)
21802180  AM_RANGE(0xff80,0xffff) AM_READWRITE8(towns_video_cff80_r,towns_video_cff80_w,0xffffffff)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team