Previous 199869 Revisions Next

r21864 Friday 15th March, 2013 at 01:01:23 UTC by Angelo Salese
Preliminary scroll, just to realize that I need to rewrite the video emulation ...
[src/mess/drivers]fp200.c

trunk/src/mess/drivers/fp200.c
r21863r21864
6969   m_lcd.attr = auto_alloc_array_clear(machine(), UINT8, 20*64);
7070}
7171
72/* TODO: Very preliminary, I actually believe that the LCDC writes in a blitter fashion ... */
7273UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
7374{
75   UINT16 l_offs, r_offs;
76
77   bitmap.fill(0, cliprect);
78
79   l_offs = 0;
80   r_offs = 0;
7481   for(int y=cliprect.min_y;y<cliprect.max_y;y++)
7582   {
76      for(int x=cliprect.min_x;x<cliprect.max_x;x++)
83      for(int x=0;x<80;x++)
7784      {
78         if(m_lcd.attr[x/8+y*20] == 0x60)
85         if(m_lcd.attr[x/8+y*20] == 0x50)
7986         {
87            l_offs = (y & ~7);
88            break;
89         }
90      }
91   }
92
93   for(int y=cliprect.min_y;y<cliprect.max_y;y++)
94   {
95      for(int x=80;x<160;x++)
96      {
97         if(m_lcd.attr[x/8+y*20] == 0x50)
98         {
99            r_offs = (y & ~7);
100            break;
101         }
102      }
103   }
104
105   for(int y=cliprect.min_y;y<cliprect.max_y;y++)
106   {
107      for(int x=0;x<80;x++)
108      {
109         UINT16 yoffs;
110
111         yoffs = y + l_offs;
112
113         if(yoffs >= 64)
114            yoffs -= 64;
115
116         if(m_lcd.attr[x/8+yoffs*20] == 0x60 || m_lcd.attr[x/8+yoffs*20] == 0x50)
117         {
80118            UINT8 vram,pix;
81119
82            vram = m_lcd.vram[x/8+y*20];
83            pix = ((m_chargen[vram*8+(x & 7)]) >> (7-(y & 7))) & 1;
120            vram = m_lcd.vram[x/8+yoffs*20];
121            pix = ((m_chargen[vram*8+(x & 7)]) >> (7-(yoffs & 7))) & 1;
84122            bitmap.pix16(y,x) = pix;
85123         }
86         /* fake, to see where the scrolling should stay. */
87         if(m_lcd.attr[x/8+y*20] == 0x50)
88            bitmap.pix16(y,x) = machine().rand() & 1;
124         /*
125         else if(m_lcd.attr[x/8+yoffs*20] == 0x40)
126         {
127            UINT8 vram,pix;
128
129            vram = m_lcd.vram[x/8+yoffs*20];
130            pix = (vram) >> (7-(yoffs & 7)) & 1;
131            bitmap.pix16(y,x) = pix;
132         }*/
89133      }
90134   }
91135
136   for(int y=cliprect.min_y;y<cliprect.max_y;y++)
137   {
138      for(int x=80;x<160;x++)
139      {
140         UINT16 yoffs;
141
142         yoffs = y + r_offs;
143
144         if(yoffs >= 64)
145            yoffs -= 64;
146
147         if(m_lcd.attr[x/8+yoffs*20] == 0x60 || m_lcd.attr[x/8+yoffs*20] == 0x50)
148         {
149            UINT8 vram,pix;
150
151            vram = m_lcd.vram[x/8+yoffs*20];
152            pix = ((m_chargen[vram*8+(x & 7)]) >> (7-(yoffs & 7))) & 1;
153            bitmap.pix16(y,x) = pix;
154         }
155         /*else if(m_lcd.attr[x/8+yoffs*20] == 0x40)
156         {
157            UINT8 vram,pix;
158
159            vram = m_lcd.vram[x/8+yoffs*20];
160            pix = (vram) >> (7-(yoffs & 7)) & 1;
161            bitmap.pix16(y,x) = pix;
162         }*/
163      }
164   }
165
92166   return 0;
93167}
94168
r21863r21864
144218   switch(offset)
145219   {
146220      case 1:
147         printf("%d %d -> (L) %02x\n",m_lcd.x,m_lcd.y,m_lcd.status);
221         //printf("%d %d -> (L) %02x\n",m_lcd.x,m_lcd.y,m_lcd.status);
148222         if(m_lcd.status == 0xb)
149223            res = read_lcd_attr(m_lcd.x,m_lcd.y);
150224         else if(m_lcd.status == 1)
151225            res = read_lcd_vram(m_lcd.x,m_lcd.y);
152226         break;
153227      case 2:
154         printf("%d %d -> (R) %02x\n",m_lcd.x,m_lcd.y,m_lcd.status);
228         //printf("%d %d -> (R) %02x\n",m_lcd.x,m_lcd.y,m_lcd.status);
155229         if(m_lcd.status == 0xb)
156230            res = read_lcd_attr(m_lcd.x + 10,m_lcd.y);
157231         else if(m_lcd.status == 1)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team