Previous 199869 Revisions Next

r36213 Tuesday 3rd March, 2015 at 03:22:39 UTC by Carl
(mess) pasogo: screen size and color guess (nw)
[src/mess/drivers]pasogo.c

trunk/src/mess/drivers/pasogo.c
r244724r244725
465465   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("b") PORT_CODE(KEYCODE_B)
466466INPUT_PORTS_END
467467
468static const unsigned char pasogo_palette[][3] =
469{
470   { 0, 0, 0 },
471   { 45,45,43 },
472   { 130, 159, 166 },
473   { 255,255,255 }
474};
475
476468PALETTE_INIT_MEMBER(pasogo_state, pasogo)
477469{
478   int i;
479
480   for ( i = 0; i < ARRAY_LENGTH(pasogo_palette); i++ )
481   {
482      palette.set_pen_color(i, pasogo_palette[i][0], pasogo_palette[i][1], pasogo_palette[i][2]);
483   }
470   palette.set_pen_color(0, rgb_t(160, 190, 170));
471   palette.set_pen_color(1, rgb_t(40, 50, 70));
484472}
485473
486474
487475UINT32 pasogo_state::screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
488476{
489   //static int width = -1, height = -1;
490   UINT8 *rom = (UINT8 *)m_vram.target();
491   static const UINT16 c[] = { 3, 0 };
492   int x,y;
493//  plot_box(bitmap, 0, 0, 64/*bitmap.width*/, bitmap.height, 0);
494   int w = 640;
495   int h = 240;
496   if (0)
477   UINT8 *vram = (UINT8 *)m_vram.target();
478   int x, y;
479   for (y=0; y<240; y++)
497480   {
498      w = 320;
499      h = 240;
500      for (y=0; y<h; y++)
481      for (x=0; x<(320/8); x++)
501482      {
502         for (x=0; x<w; x+=4)
503         {
504            int a = (y & 1) * 0x2000;
505            UINT8 d = rom[a + (y & ~1) * 80/2 + x/4];
506            UINT16 *line = &bitmap.pix16(y, x);
507            *line++ = (d >> 6) & 3;
508            *line++ = (d >> 4) & 3;
509            *line++ = (d >> 2) & 3;
510            *line++ = (d >> 0) & 3;
511         }
483         int a = (y & 3) * 0x2000;
484         UINT8 d1 = vram[a + (y >> 2) * 80 + x];
485         UINT16 *line = &bitmap.pix16(y, x << 3);
486         *line++ = ((d1 >> 7) & 1);
487         *line++ = ((d1 >> 6) & 1);
488         *line++ = ((d1 >> 5) & 1);
489         *line++ = ((d1 >> 4) & 1);
490         *line++ = ((d1 >> 3) & 1);
491         *line++ = ((d1 >> 2) & 1);
492         *line++ = ((d1 >> 1) & 1);
493         *line++ = ((d1 >> 0) & 1);
512494      }
513495   }
514   else
515   {
516      for (y=0; y<h; y++)
517      {
518         for (x=0; x<w; x+=8)
519         {
520            int a = (y & 3) * 0x2000;
521            UINT8 d = rom[a + (y & ~3) * 80/4 + x/8];
522            UINT16 *line = &bitmap.pix16(y, x);
523            *line++ = c[(d >> 7) & 1];
524            *line++ = c[(d >> 6) & 1];
525            *line++ = c[(d >> 5) & 1];
526            *line++ = c[(d >> 4) & 1];
527            *line++ = c[(d >> 3) & 1];
528            *line++ = c[(d >> 2) & 1];
529            *line++ = c[(d >> 1) & 1];
530            *line++ = c[(d >> 0) & 1];
531         }
532      }
533   }
534#if 0
535   if (w!=width || h!=height)
536   {
537      width = w; height = h;
538//      machine().first_screen()->set_visible_area(0, width - 1, 0, height - 1);
539      screen.set_visible_area(0, width - 1, 0, height - 1);
540   }
541#endif
542496   return 0;
543497}
544498
r244724r244725
582536   // The carts use vg230 specific registers and mostly ignore the mc6845.
583537   MCFG_SCREEN_ADD("screen", LCD)
584538   MCFG_SCREEN_REFRESH_RATE(60)
585   MCFG_SCREEN_SIZE(640, 400)
586   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
539   MCFG_SCREEN_SIZE(320, 240)
540   MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
587541   MCFG_SCREEN_UPDATE_DRIVER(pasogo_state, screen_update_pasogo)
588542   MCFG_SCREEN_PALETTE("palette")
589   MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(pasogo_palette))
543   MCFG_PALETTE_ADD("palette", 2)
590544   MCFG_PALETTE_INIT_OWNER(pasogo_state, pasogo)
591545
592546   MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "pasogo_cart")


Previous 199869 Revisions Next


© 1997-2024 The MAME Team