Previous 199869 Revisions Next

r17518 Monday 27th August, 2012 at 19:39:46 UTC by Angelo Salese
Testing vertical scrolling, TBD
[src/emu/video]m50458.c m50458.h

trunk/src/emu/video/m50458.c
r17517r17518
2121static ADDRESS_MAP_START( m50458_vram, AS_0, 16, m50458_device )
2222   AM_RANGE(0x0000, 0x023f) AM_RAM // vram
2323   AM_RANGE(0x0240, 0x0241) AM_WRITE(vreg_120_w)
24//   AM_RANGE(0x0242, 0x0243) AM_WRITE(vreg_121_w)
25   AM_RANGE(0x0244, 0x0245) AM_WRITE(vreg_122_w)
26   AM_RANGE(0x0246, 0x0247) AM_WRITE(vreg_123_w)
2427   AM_RANGE(0x024c, 0x024d) AM_WRITE(vreg_126_w)
2528   AM_RANGE(0x024e, 0x024f) AM_WRITE(vreg_127_w)
2629ADDRESS_MAP_END
r17517r17518
3639//   printf("%04x\n",data);
3740}
3841
42WRITE16_MEMBER( m50458_device::vreg_122_w)
43{
44//   printf("%04x\n",data);
45}
46
47WRITE16_MEMBER( m50458_device::vreg_123_w)
48{
49   /* fractional part of vertical scrolling */
50   m_scrf = data & 0x1f;
51
52   m_space = (data & 0x60) >> 5;
53
54   /* char part of vertical scrolling */
55   m_scrr = (data & 0x0f00) >> 8;
56
57   printf("%02x %02x %02x\n",m_scrr,m_scrf,m_space);
58}
59
3960WRITE16_MEMBER( m50458_device::vreg_126_w)
4061{
4162   /* Raster Color Setting */
r17517r17518
168189   }
169190}
170191
171/*
1720x7e: "JUST A MOMENT"
1730x81: "NON SLOT"
174*/
175192
176193WRITE_LINE_MEMBER( m50458_device::set_clock_line )
177194{
r17517r17518
194211                  break;
195212               case OSD_SET_DATA:
196213                  //if(m_osd_addr >= 0x120)
197                  //printf("%04x %04x\n",m_osd_addr,m_current_cmd);
214                  printf("%04x %04x\n",m_osd_addr,m_current_cmd);
198215                  write_word(m_osd_addr,m_current_cmd);
199216                  m_osd_addr++;
200217                  /* Presumably wraps at 0x127? */
r17517r17518
225242   bg_b = m_phase & 4 ? 0xdf : 0;
226243   bitmap.fill(MAKE_ARGB(0xff,bg_r,bg_g,bg_b),cliprect);
227244
245
228246   for(y=0;y<12;y++)
229247   {
230248      for(x=0;x<24;x++)
231249      {
232250         int xi,yi;
233251         UINT16 tile;
252         int y_base = y;
234253
235         tile = read_word(x+y*24);
254         /* TODO: needs improvements */
255         if(y != 0 && m_scrr)
256            y_base+=(m_scrr - 1);
236257
258         if(y != 0 && y_base == 0)
259            y_base ++;
260
261         if(y_base >= 12)
262            y_base -= 11;
263
264
265         tile = read_word(x+y_base*24);
266
237267         for(yi=0;yi<18;yi++)
238268         {
239269            for(xi=4;xi<16;xi++) /* TODO: remove 4 / 16 / -4 offset once that the ROM is fixed */
trunk/src/emu/video/m50458.h
r17517r17518
4343   WRITE_LINE_MEMBER( set_cs_line );
4444   WRITE_LINE_MEMBER( set_clock_line );
4545   DECLARE_WRITE16_MEMBER(vreg_120_w);
46   DECLARE_WRITE16_MEMBER(vreg_122_w);
47   DECLARE_WRITE16_MEMBER(vreg_123_w);
4648   DECLARE_WRITE16_MEMBER(vreg_126_w);
4749   DECLARE_WRITE16_MEMBER(vreg_127_w);
4850
r17517r17518
6466   UINT16 m_osd_addr;
6567   UINT8 m_bg_pen;
6668   UINT8 m_phase;
69   UINT8 m_scrf,m_scrr;
70   UINT8 m_space;
6771
6872   m50458_state_t m_osd_state;
6973

Previous 199869 Revisions Next


© 1997-2024 The MAME Team