trunk/src/mess/drivers/mbee.c
| r244902 | r244903 | |
| 410 | 410 | PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload") |
| 411 | 411 | PORT_CONFSETTING( 0x00, DEF_STR(No)) |
| 412 | 412 | 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") |
| 413 | 419 | // Wire links on motherboard |
| 414 | 420 | PORT_CONFNAME( 0xc0, 0x00, "PIO B7") |
| 415 | 421 | PORT_CONFSETTING( 0x00, "VS") // sync pulse to enable telcom clock |
| r244902 | r244903 | |
| 427 | 433 | PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload") |
| 428 | 434 | PORT_CONFSETTING( 0x00, DEF_STR(No)) |
| 429 | 435 | 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") |
| 430 | 442 | // Wire links on motherboard |
| 431 | 443 | PORT_CONFNAME( 0xc0, 0x40, "PIO B7") |
| 432 | 444 | PORT_CONFSETTING( 0x00, "VS") // sync pulse to enable telcom clock |
| r244902 | r244903 | |
| 591 | 603 | }; |
| 592 | 604 | |
| 593 | 605 | static GFXDECODE_START( mono ) |
| 594 | | GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 0, 1 ) |
| 606 | GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 96, 1 ) |
| 595 | 607 | GFXDECODE_END |
| 596 | 608 | |
| 597 | 609 | static GFXDECODE_START( standard ) |
| r244902 | r244903 | |
| 634 | 646 | MCFG_SCREEN_UPDATE_DRIVER(mbee_state, screen_update_mbee) |
| 635 | 647 | |
| 636 | 648 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", mono) |
| 637 | | MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") // usually sold with amber or green monitor |
| 638 | 649 | |
| 650 | MCFG_PALETTE_ADD("palette", 100) |
| 651 | MCFG_PALETTE_INIT_OWNER(mbee_state, standard) |
| 652 | |
| 639 | 653 | MCFG_VIDEO_START_OVERRIDE(mbee_state, mono) |
| 640 | 654 | |
| 641 | 655 | /* sound hardware */ |
| r244902 | r244903 | |
| 649 | 663 | MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_12MHz / 8) |
| 650 | 664 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 651 | 665 | 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) |
| 653 | 667 | MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, crtc_update_addr) |
| 654 | 668 | MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(mbee_state, crtc_vs)) |
| 655 | 669 | |
| r244902 | r244903 | |
| 692 | 706 | |
| 693 | 707 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", standard) |
| 694 | 708 | |
| 695 | | MCFG_PALETTE_ADD("palette", 96) |
| 709 | MCFG_PALETTE_ADD("palette", 100) |
| 696 | 710 | MCFG_PALETTE_INIT_OWNER(mbee_state, standard) |
| 697 | 711 | |
| 698 | 712 | MCFG_VIDEO_START_OVERRIDE(mbee_state, standard) |
| r244902 | r244903 | |
| 708 | 722 | MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8) |
| 709 | 723 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 710 | 724 | 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) |
| 712 | 726 | MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, crtc_update_addr) |
| 713 | 727 | MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(mbee_state, crtc_vs)) |
| 714 | 728 | |
| r244902 | r244903 | |
| 738 | 752 | MCFG_VIDEO_START_OVERRIDE(mbee_state, premium) |
| 739 | 753 | MCFG_GFXDECODE_MODIFY("gfxdecode", premium) |
| 740 | 754 | MCFG_PALETTE_MODIFY("palette") |
| 741 | | MCFG_PALETTE_ENTRIES(16) |
| 742 | 755 | MCFG_PALETTE_INIT_OWNER(mbee_state, premium) |
| 743 | 756 | MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz ) |
| 744 | 757 | MCFG_MC146818_IRQ_HANDLER(WRITELINE(mbee_state, rtc_irq_w)) |
trunk/src/mess/video/mbee.c
| r244902 | r244903 | |
| 235 | 235 | |
| 236 | 236 | if( keydown ) |
| 237 | 237 | m_crtc->assert_light_pen_input(); //lpen_strobe |
| 238 | | |
| 239 | 238 | } |
| 240 | 239 | } |
| 241 | 240 | |
| r244902 | r244903 | |
| 291 | 290 | { |
| 292 | 291 | m_p_videoram = memregion("videoram")->base(); |
| 293 | 292 | m_p_gfxram = memregion("gfx")->base()+0x1000; |
| 293 | m_p_colorram = 0; |
| 294 | m_p_attribram = 0; |
| 294 | 295 | m_is_premium = 0; |
| 295 | 296 | } |
| 296 | 297 | |
| 297 | 298 | VIDEO_START_MEMBER( mbee_state, standard ) |
| 298 | 299 | { |
| 299 | 300 | m_p_videoram = memregion("videoram")->base(); |
| 300 | | m_p_colorram = memregion("colorram")->base(); |
| 301 | 301 | m_p_gfxram = memregion("gfx")->base()+0x1000; |
| 302 | m_p_colorram = memregion("colorram")->base(); |
| 303 | m_p_attribram = 0; |
| 302 | 304 | m_is_premium = 0; |
| 303 | 305 | } |
| 304 | 306 | |
| r244902 | r244903 | |
| 328 | 330 | } |
| 329 | 331 | |
| 330 | 332 | |
| 331 | | /* monochrome bee */ |
| 332 | | MC6845_UPDATE_ROW( mbee_state::mono_update_row ) |
| 333 | MC6845_UPDATE_ROW( mbee_state::crtc_update_row ) |
| 333 | 334 | { |
| 334 | 335 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| 335 | | UINT8 chr,gfx; |
| 336 | | UINT16 mem,x; |
| 337 | | UINT32 *p = &bitmap.pix32(y); |
| 338 | 336 | |
| 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 */ |
| 367 | | MC6845_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 |
| 372 | 338 | 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 | |
| 373 | 344 | UINT32 *p = &bitmap.pix32(y); |
| 345 | UINT8 inv, attr=0, gfx, fg=96+monopal, bg=96, col=0; |
| 346 | UINT16 mem, x, chr; |
| 374 | 347 | |
| 375 | 348 | for (x = 0; x < x_count; x++) // for each character |
| 376 | 349 | { |
| 377 | 350 | inv = 0; |
| 378 | 351 | mem = (ma + x) & 0x7ff; |
| 379 | 352 | chr = m_p_videoram[mem]; |
| 380 | | col = m_p_colorram[mem]; // read a byte of colour |
| 381 | 353 | |
| 382 | 354 | if BIT(m_1c, 7) // premium graphics enabled? |
| 383 | 355 | { |
| r244902 | r244903 | |
| 403 | 375 | gfx = m_p_gfxram[(chr<<4) | ra] ^ inv; |
| 404 | 376 | |
| 405 | 377 | // get colours |
| 406 | | if (m_is_premium) |
| 378 | if (!monopal) |
| 407 | 379 | { |
| 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 | } |
| 410 | 392 | } |
| 411 | | else |
| 412 | | { |
| 413 | | fg = (col & 0x1f) | 64; |
| 414 | | bg = ((col & 0xe0) >> 2) | colourm; |
| 415 | | } |
| 416 | 393 | |
| 417 | 394 | /* Display a scanline of a character (8 pixels) */ |
| 418 | 395 | *p++ = palette[BIT(gfx, 7) ? fg : bg]; |
| r244902 | r244903 | |
| 474 | 451 | b = fglevel[(BIT(k, 0))|(BIT(k, 3)<<1)]; |
| 475 | 452 | palette.set_pen_color(i|64, rgb_t(r, g, b)); |
| 476 | 453 | } |
| 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 |
| 477 | 460 | } |
| 478 | 461 | |
| 479 | 462 | |
| r244902 | r244903 | |
| 501 | 484 | b = BIT(i, 2) ? 0xff : 0; |
| 502 | 485 | palette.set_pen_color(i, rgb_t(r, g, b)); |
| 503 | 486 | } |
| 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 |
| 504 | 493 | } |