Previous 199869 Revisions Next

r36391 Thursday 12th March, 2015 at 14:18:47 UTC by Robbbert
(MESS) mbee : added choice of monochrome or colour, since the real machines could be purchased this way. (nw)
[src/mess/drivers]mbee.c
[src/mess/includes]mbee.h
[src/mess/video]mbee.c

trunk/src/mess/drivers/mbee.c
r244902r244903
410410   PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
411411   PORT_CONFSETTING(    0x00, DEF_STR(No))
412412   PORT_CONFSETTING(    0x01, DEF_STR(Yes))
413   // monochrome monitor could be used
414   PORT_CONFNAME( 0x30, 0x00, "Monitor type")
415   PORT_CONFSETTING(    0x00, "Colour")
416   PORT_CONFSETTING(    0x10, "Green")
417   PORT_CONFSETTING(    0x20, "Amber")
418   PORT_CONFSETTING(    0x30, "White")
413419   // Wire links on motherboard
414420   PORT_CONFNAME( 0xc0, 0x00, "PIO B7")
415421   PORT_CONFSETTING(    0x00, "VS") // sync pulse to enable telcom clock
r244902r244903
427433   PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
428434   PORT_CONFSETTING(    0x00, DEF_STR(No))
429435   PORT_CONFSETTING(    0x01, DEF_STR(Yes))
436   // monochrome monitor could be used
437   PORT_CONFNAME( 0x30, 0x00, "Monitor type")
438   PORT_CONFSETTING(    0x00, "Colour")
439   PORT_CONFSETTING(    0x10, "Green")
440   PORT_CONFSETTING(    0x20, "Amber")
441   PORT_CONFSETTING(    0x30, "White")
430442   // Wire links on motherboard
431443   PORT_CONFNAME( 0xc0, 0x40, "PIO B7")
432444   PORT_CONFSETTING(    0x00, "VS") // sync pulse to enable telcom clock
r244902r244903
591603};
592604
593605static GFXDECODE_START( mono )
594   GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 0, 1 )
606   GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 96, 1 )
595607GFXDECODE_END
596608
597609static GFXDECODE_START( standard )
r244902r244903
634646   MCFG_SCREEN_UPDATE_DRIVER(mbee_state, screen_update_mbee)
635647
636648   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mono)
637   MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") // usually sold with amber or green monitor
638649
650   MCFG_PALETTE_ADD("palette", 100)
651   MCFG_PALETTE_INIT_OWNER(mbee_state, standard)
652
639653   MCFG_VIDEO_START_OVERRIDE(mbee_state, mono)
640654
641655   /* sound hardware */
r244902r244903
649663   MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_12MHz / 8)
650664   MCFG_MC6845_SHOW_BORDER_AREA(false)
651665   MCFG_MC6845_CHAR_WIDTH(8)
652   MCFG_MC6845_UPDATE_ROW_CB(mbee_state, mono_update_row)
666   MCFG_MC6845_UPDATE_ROW_CB(mbee_state, crtc_update_row)
653667   MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, crtc_update_addr)
654668   MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(mbee_state, crtc_vs))
655669
r244902r244903
692706
693707   MCFG_GFXDECODE_ADD("gfxdecode", "palette", standard)
694708
695   MCFG_PALETTE_ADD("palette", 96)
709   MCFG_PALETTE_ADD("palette", 100)
696710   MCFG_PALETTE_INIT_OWNER(mbee_state, standard)
697711
698712   MCFG_VIDEO_START_OVERRIDE(mbee_state, standard)
r244902r244903
708722   MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8)
709723   MCFG_MC6845_SHOW_BORDER_AREA(false)
710724   MCFG_MC6845_CHAR_WIDTH(8)
711   MCFG_MC6845_UPDATE_ROW_CB(mbee_state, colour_update_row)
725   MCFG_MC6845_UPDATE_ROW_CB(mbee_state, crtc_update_row)
712726   MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, crtc_update_addr)
713727   MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(mbee_state, crtc_vs))
714728
r244902r244903
738752   MCFG_VIDEO_START_OVERRIDE(mbee_state, premium)
739753   MCFG_GFXDECODE_MODIFY("gfxdecode", premium)
740754   MCFG_PALETTE_MODIFY("palette")
741   MCFG_PALETTE_ENTRIES(16)
742755   MCFG_PALETTE_INIT_OWNER(mbee_state, premium)
743756   MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
744757   MCFG_MC146818_IRQ_HANDLER(WRITELINE(mbee_state, rtc_irq_w))
trunk/src/mess/includes/mbee.h
r244902r244903
105105   DECLARE_MACHINE_RESET(mbeett);
106106   UINT32 screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
107107   TIMER_CALLBACK_MEMBER(timer_newkb);
108   TIMER_CALLBACK_MEMBER(timer_boot);
109108   DECLARE_QUICKLOAD_LOAD_MEMBER(mbee);
110109   DECLARE_QUICKLOAD_LOAD_MEMBER(mbee_z80bin);
111110   WRITE_LINE_MEMBER(rtc_irq_w);
112111   WRITE_LINE_MEMBER(fdc_intrq_w);
113112   WRITE_LINE_MEMBER(fdc_drq_w);
114   MC6845_UPDATE_ROW(mono_update_row);
115   MC6845_UPDATE_ROW(colour_update_row);
113   MC6845_UPDATE_ROW(crtc_update_row);
116114   MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update_addr);
117115
118116   required_device<palette_device> m_palette;
trunk/src/mess/video/mbee.c
r244902r244903
235235
236236      if( keydown )
237237         m_crtc->assert_light_pen_input(); //lpen_strobe
238
239238   }
240239}
241240
r244902r244903
291290{
292291   m_p_videoram = memregion("videoram")->base();
293292   m_p_gfxram = memregion("gfx")->base()+0x1000;
293   m_p_colorram = 0;
294   m_p_attribram = 0;
294295   m_is_premium = 0;
295296}
296297
297298VIDEO_START_MEMBER( mbee_state, standard )
298299{
299300   m_p_videoram = memregion("videoram")->base();
300   m_p_colorram = memregion("colorram")->base();
301301   m_p_gfxram = memregion("gfx")->base()+0x1000;
302   m_p_colorram = memregion("colorram")->base();
303   m_p_attribram = 0;
302304   m_is_premium = 0;
303305}
304306
r244902r244903
328330}
329331
330332
331/* monochrome bee */
332MC6845_UPDATE_ROW( mbee_state::mono_update_row )
333MC6845_UPDATE_ROW( mbee_state::crtc_update_row )
333334{
334335   const rgb_t *palette = m_palette->palette()->entry_list_raw();
335   UINT8 chr,gfx;
336   UINT16 mem,x;
337   UINT32 *p = &bitmap.pix32(y);
338336
339   for (x = 0; x < x_count; x++)           // for each character
340   {
341      UINT8 inv=0;
342      mem = (ma + x) & 0x7ff;
343      chr = m_p_videoram[mem];
344
345      oldkb_scan(x+ma);
346
347      /* process cursor */
348      if (x == cursor_x)
349         inv ^= m_sy6545_cursor[ra];          // cursor scan row
350
351      /* get pattern of pixels for that character scanline */
352      gfx = m_p_gfxram[(chr<<4) | ra] ^ inv;
353
354      /* Display a scanline of a character (8 pixels) */
355      *p++ = palette[BIT(gfx, 7)];
356      *p++ = palette[BIT(gfx, 6)];
357      *p++ = palette[BIT(gfx, 5)];
358      *p++ = palette[BIT(gfx, 4)];
359      *p++ = palette[BIT(gfx, 3)];
360      *p++ = palette[BIT(gfx, 2)];
361      *p++ = palette[BIT(gfx, 1)];
362      *p++ = palette[BIT(gfx, 0)];
363   }
364}
365
366/* colour bee */
367MC6845_UPDATE_ROW( mbee_state::colour_update_row )
368{
369   const rgb_t *palette = m_palette->palette()->entry_list_raw();
370   UINT8 inv,attr,gfx,fg,bg,col;
371   UINT16 mem,x,chr;
337   // colours
372338   UINT8 colourm = (m_08 & 0x0e) >> 1;
339   UINT8 monopal = (m_io_config->read() & 0x30) >> 4;
340   // if colour chosen on mono bee, default to amber
341   if (!monopal && !m_p_colorram)
342      monopal = 2;
343
373344   UINT32 *p = &bitmap.pix32(y);
345   UINT8 inv, attr=0, gfx, fg=96+monopal, bg=96, col=0;
346   UINT16 mem, x, chr;
374347
375348   for (x = 0; x < x_count; x++)           // for each character
376349   {
377350      inv = 0;
378351      mem = (ma + x) & 0x7ff;
379352      chr = m_p_videoram[mem];
380      col = m_p_colorram[mem];                     // read a byte of colour
381353
382354      if BIT(m_1c, 7) // premium graphics enabled?
383355      {
r244902r244903
403375      gfx = m_p_gfxram[(chr<<4) | ra] ^ inv;
404376
405377      // get colours
406      if (m_is_premium)
378      if (!monopal)
407379      {
408         fg = col & 15;
409         bg = col >> 4;
380         col = m_p_colorram[mem];                     // read a byte of colour
381
382         if (m_is_premium)
383         {
384            fg = col & 15;
385            bg = col >> 4;
386         }
387         else
388         {
389            fg = (col & 0x1f) | 64;
390            bg = ((col & 0xe0) >> 2) | colourm;
391         }
410392      }
411      else
412      {
413         fg = (col & 0x1f) | 64;
414         bg = ((col & 0xe0) >> 2) | colourm;
415      }
416393
417394      /* Display a scanline of a character (8 pixels) */
418395      *p++ = palette[BIT(gfx, 7) ? fg : bg];
r244902r244903
474451      b = fglevel[(BIT(k, 0))|(BIT(k, 3)<<1)];
475452      palette.set_pen_color(i|64, rgb_t(r, g, b));
476453   }
454
455   // monochrome palette
456   palette.set_pen_color(96, rgb_t(0x00, 0x00, 0x00)); // black
457   palette.set_pen_color(97, rgb_t(0x00, 0xff, 0x00)); // green
458   palette.set_pen_color(98, rgb_t(0xf7, 0xaa, 0x00)); // amber
459   palette.set_pen_color(99, rgb_t(0xff, 0xff, 0xff)); // white
477460}
478461
479462
r244902r244903
501484      b = BIT(i, 2) ? 0xff : 0;
502485      palette.set_pen_color(i, rgb_t(r, g, b));
503486   }
487
488   // monochrome palette
489   palette.set_pen_color(96, rgb_t(0x00, 0x00, 0x00)); // black
490   palette.set_pen_color(97, rgb_t(0x00, 0xff, 0x00)); // green
491   palette.set_pen_color(98, rgb_t(0xf7, 0xaa, 0x00)); // amber
492   palette.set_pen_color(99, rgb_t(0xff, 0xff, 0xff)); // white
504493}


Previous 199869 Revisions Next


© 1997-2024 The MAME Team