Previous 15994 Revisions Next

r9284 Thursday 30th September, 2010 at 00:05:28 UTC by Robbbert
[MBEE] Premium - added inverse and flashing attributes, fixed colours. Added support for extended gfx bit.
[src/mess/drivers]mbee.c
[src/mess/includes]mbee.h
[src/mess/video]mbee.c

src/mess/video/mbee.c
r9283r9284
173173
174174WRITE8_HANDLER( mbeeppc_1c_w )
175175{
176/*  d7 extended graphics - not emulated
176/*  d7 extended graphics (1=allow attributes and pcg banks)
177177    d5 bankswitch basic rom
178178    d4 select attribute ram
179179    d3..d0 select videoram bank */
r9283r9284
684684   UINT8 speed = crt.cursor_top&0x20, flash = crt.cursor_top&0x40;            // cursor modes
685685   UINT16 cursor = (crt.cursor_address_hi<<8) | crt.cursor_address_lo;         // get cursor position
686686   UINT16 screen_home = (crt.screen_address_hi<<8) | crt.screen_address_lo;      // screen home offset (usually zero)
687   UINT16 colourm = (mbee_08 & 0x0e) << 7;
688687
689688   framecnt++;
690689
r9283r9284
699698            UINT8 inv=0;
700699            mem = (x + screen_home) & 0x7ff;
701700            chr = videoram[mem];
702            col = colorram[mem] | colourm;               // read a byte of colour
701            col = colorram[mem];                  // read a byte of colour
703702
704            if (chr & 0x80)
705               chr += (attribram[mem] << 7);            // bump chr to its particular pcg definition
703            if (mbee_1c & 0x80)                  // are extended features enabled?
704            {
705               UINT8 attr = attribram[mem];
706706
707               if (chr & 0x80)
708                  chr += ((attr & 15) << 7);         // bump chr to its particular pcg definition
709
710               if (attr & 0x40)
711                  inv ^= 0xff;               // inverse attribute
712
713
714               /* Flashing attribute - flash speed is unknown */
715               if ((attr & 0x80) && (framecnt & 8))
716                  chr = 0x20;
717            }
718
707719            if ((x & 15) == 0)
708720            {
709721               if (mbee_wait_time)
r9283r9284
721733
722734            /* get pattern of pixels for that character scanline */
723735            gfx = gfxram[(chr<<4) | ra] ^ inv;
724            fg = (col & 0x001f) | 64;               // map to foreground palette
725            bg = (col & 0x07e0) >> 5;               // and background palette
736            fg = col & 15;                     // map to foreground palette
737            bg = (col & 0xf0) >> 4;                  // and background palette
726738
727739            /* Display a scanline of a character (8 pixels) */
728740            *p = ( gfx & 0x80 ) ? fg : bg; p++;
r9283r9284
766778      palette_set_color(machine, i|64, MAKE_RGB(r, g, b));
767779   }
768780}
781
782
783PALETTE_INIT( mbeeppc )
784{
785   UINT16 i;
786   UINT8 r, b, g;
787
788   /* set up 8 low intensity colours */
789   for (i = 0; i < 8; i++)
790   {
791      r = (i & 1) ? 0x80 : 0;
792      g = (i & 2) ? 0x80 : 0;
793      b = (i & 4) ? 0x80 : 0;
794      palette_set_color(machine, i, MAKE_RGB(r, g, b));
795   }
796
797   /* set up 8 high intensity colours */
798   for (i = 9; i < 16; i++)
799   {
800      r = (i & 1) ? 0xff : 0;
801      g = (i & 2) ? 0xff : 0;
802      b = (i & 4) ? 0xff : 0;
803      palette_set_color(machine, i, MAKE_RGB(r, g, b));
804   }
805}
806
src/mess/includes/mbee.h
r9283r9284
8181VIDEO_START( mbeeppc );
8282VIDEO_UPDATE( mbeeppc );
8383PALETTE_INIT( mbeeic );
84PALETTE_INIT( mbeeppc );
8485
8586#endif /* MBEE_H_ */
src/mess/drivers/mbee.c
r9283r9284
364364   GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 0, 48 )
365365GFXDECODE_END
366366
367static GFXDECODE_START( mbeeppc )
368   GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 0, 8 )
369GFXDECODE_END
370
367371static FLOPPY_OPTIONS_START(mbee)
368372   FLOPPY_OPTION(ss80, "ss80", "SS80 disk image", basicdsk_identify_default, basicdsk_construct_default,
369373      HEADS([1])
r9283r9284
502506   MDRV_CPU_IO_MAP(mbeeppc_io)
503507   MDRV_VIDEO_START(mbeeppc)
504508   MDRV_VIDEO_UPDATE(mbeeppc)
509   MDRV_GFXDECODE(mbeeppc)
510   MDRV_PALETTE_LENGTH(16)
511   MDRV_PALETTE_INIT(mbeeppc)
505512MACHINE_CONFIG_END
506513
507514static MACHINE_CONFIG_DERIVED( mbee56, mbeeic )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team