Previous 15994 Revisions Next

r7900 Monday 26th April, 2010 at 11:06:50 UTC by Robbbert
[PEGASUS] Added reverse video. Pegapong game works.
[src/mess/drivers]pegasus.c
[src/mess/video]pegasus.c

src/mess/video/pegasus.c
r7899r7900
158158{
159159   if (!mcm6571a_shift[code])
160160   {
161      if (line < 9)
162         return mcm6571a[code*9 + line];
161      if (line < 1)
162         return 0;
163163      else
164      if (line < 10)
165         return mcm6571a[code*9 + line - 1];
166      else
164167         return 0;
165168   }
166169   else
167170   {
168      if (line < 3)
171      if (line < 4)
169172         return 0;
170173      else
171      if (line <12)
172         return mcm6571a[code*9 + line - 3];
174      if (line <13)
175         return mcm6571a[code*9 + line - 4];
173176      else
174177         return 0;
175178   }
r7899r7900
180183VIDEO_UPDATE( pegasus )
181184{
182185   UINT16 addr,xpos,x,y;
183   UINT8 b,j,l,r,code;
186   UINT8 b,j,l,code,inv;
184187
185188   for(y = 0; y < 16; y++ )
186189   {
187      addr = y*32;
190      addr = y<<5;
188191      xpos = 0;
189192      for(x = 0; x < 32; x++ )
190193      {
191         code = pegasus_video_ram[addr + x];
192         if (!(code & 0x80))
194         code = pegasus_video_ram[addr|x];
195         inv = (code >> 7) ^ 1;
196         for(j = 0; j < 16; j++ )
193197         {
194            for(j = 0; j < 15; j++ )
195            {
196               l = j/5;
197               for(b = 0; b < 10; b++ )
198               {
199                  r = b/5;
200                  if (l==0 && r==0)
201                     *BITMAP_ADDR16(bitmap, y*15+j, xpos+b ) = BIT(code,5) ? 0 : 1;
202                  else
203                  if (l==0 && r==1)
204                     *BITMAP_ADDR16(bitmap, y*15+j, xpos+b ) = BIT(code,2) ? 0 : 1;
205                  else
206                  if (l==1 && r==0)
207                     *BITMAP_ADDR16(bitmap, y*15+j, xpos+b ) = BIT(code,4) ? 0 : 1;
208                  else
209                  if (l==1 && r==1)
210                     *BITMAP_ADDR16(bitmap, y*15+j, xpos+b ) = BIT(code,1) ? 0 : 1;
211                  else
212                  if (l==2 && r==0)
213                     *BITMAP_ADDR16(bitmap, y*15+j, xpos+b ) = BIT(code,3) ? 0 : 1;
214                  else
215                  if (l==2 && r==1)
216                     *BITMAP_ADDR16(bitmap, y*15+j, xpos+b ) = BIT(code,0) ? 0 : 1;
217               }
218            }
198            l = get_mcm6571a_line(code &0x7f, j);
199            for(b = 0; b < 7; b++ )
200               *BITMAP_ADDR16(bitmap, (y<<4)|j, xpos+b ) =  inv ^ ((l >> (6-b)) & 1);
201            *BITMAP_ADDR16(bitmap, (y<<4)|j, xpos+7 ) =  inv;
219202         }
220         else
221         {
222            for(j = 0; j < 15; j++ )
223            {
224               l = get_mcm6571a_line(code &0x7f, j);
225               for(b = 0; b < 7; b++ )
226                  *BITMAP_ADDR16(bitmap, y*15+j, xpos+b ) =  (l >> (6-b)) & 1;
227               *BITMAP_ADDR16(bitmap, y*15+j, xpos+7 ) =  0;
228               *BITMAP_ADDR16(bitmap, y*15+j, xpos+8 ) =  0;
229               *BITMAP_ADDR16(bitmap, y*15+j, xpos+9 ) =  0;
230            }
231         }
232         xpos += 10;
203         xpos +=8;
233204      }
234205   }
235206   return 0;
src/mess/drivers/pegasus.c
r7899r7900
8181
8282static ADDRESS_MAP_START(pegasus_mem, ADDRESS_SPACE_PROGRAM, 8)
8383   ADDRESS_MAP_UNMAP_HIGH
84   AM_RANGE(0x0000, 0xbdff) AM_RAM
84   AM_RANGE(0x0000, 0x1fff) AM_ROM
85   AM_RANGE(0xb000, 0xbdff) AM_RAM
8586   AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_BASE(&pegasus_video_ram)
8687   AM_RANGE(0xc000, 0xdfff) AM_ROM
8788   AM_RANGE(0xe200, 0xe3ff) AM_RAM      // PCG
r7899r7900
221222
222223static DEVICE_IMAGE_LOAD( pegasus_cart_1 )
223224{
224   image_fread(image, memory_region(image->machine, "maincpu") + 0xc000, 0x1000);
225   image_fread(image, memory_region(image->machine, "maincpu") + 0x0000, 0x1000);
225226
226227   return INIT_PASS;
227228}
228229
229230static DEVICE_IMAGE_LOAD( pegasus_cart_2 )
230231{
232   image_fread(image, memory_region(image->machine, "maincpu") + 0x1000, 0x1000);
233
234   return INIT_PASS;
235}
236
237static DEVICE_IMAGE_LOAD( pegasus_cart_3 )
238{
239   image_fread(image, memory_region(image->machine, "maincpu") + 0xc000, 0x1000);
240
241   return INIT_PASS;
242}
243
244static DEVICE_IMAGE_LOAD( pegasus_cart_4 )
245{
231246   image_fread(image, memory_region(image->machine, "maincpu") + 0xd000, 0x1000);
232247
233248   return INIT_PASS;
r7899r7900
250265   MDRV_SCREEN_REFRESH_RATE(50)
251266   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
252267   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
253   MDRV_SCREEN_SIZE(32*10, 16*16)
254   MDRV_SCREEN_VISIBLE_AREA(0, 32*10-1, 0, 16*15-1)
268   MDRV_SCREEN_SIZE(32*8, 16*16)
269   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 16*16-1)
255270   MDRV_PALETTE_LENGTH(2)
256271   MDRV_PALETTE_INIT(black_and_white)
257272   MDRV_VIDEO_UPDATE(pegasus)
r7899r7900
265280   MDRV_CARTSLOT_ADD("cart2")
266281   MDRV_CARTSLOT_EXTENSION_LIST("bin")
267282   MDRV_CARTSLOT_LOAD(pegasus_cart_2)
283   MDRV_CARTSLOT_ADD("cart3")
284   MDRV_CARTSLOT_EXTENSION_LIST("bin")
285   MDRV_CARTSLOT_LOAD(pegasus_cart_3)
286   MDRV_CARTSLOT_ADD("cart4")
287   MDRV_CARTSLOT_EXTENSION_LIST("bin")
288   MDRV_CARTSLOT_LOAD(pegasus_cart_4)
268289   MDRV_CASSETTE_ADD( "cassette", pegasus_cassette_config )
269290//   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
270291MACHINE_DRIVER_END

Previous 15994 Revisions Next


© 1998-2018 The MESS Team