trunk/src/mame/drivers/hornet.c
| r24046 | r24047 | |
| 405 | 405 | READ32_MEMBER(hornet_state::hornet_k037122_sram_r) |
| 406 | 406 | { |
| 407 | 407 | k037122_device *k037122 = get_cgboard_id() ? m_k037122_2 : m_k037122_1; |
| 408 | | return k037122_sram_r(k037122, space, offset, mem_mask); |
| 408 | return k037122->sram_r(space, offset, mem_mask); |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | WRITE32_MEMBER(hornet_state::hornet_k037122_sram_w) |
| 412 | 412 | { |
| 413 | 413 | k037122_device *k037122 = get_cgboard_id() ? m_k037122_2 : m_k037122_1; |
| 414 | | k037122_sram_w(k037122, space, offset, data, mem_mask); |
| 414 | k037122->sram_w(space, offset, data, mem_mask); |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | |
| 418 | 418 | READ32_MEMBER(hornet_state::hornet_k037122_char_r) |
| 419 | 419 | { |
| 420 | 420 | k037122_device *k037122 = get_cgboard_id() ? m_k037122_2 : m_k037122_1; |
| 421 | | return k037122_char_r(k037122, space, offset, mem_mask); |
| 421 | return k037122->char_r(space, offset, mem_mask); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | WRITE32_MEMBER(hornet_state::hornet_k037122_char_w) |
| 425 | 425 | { |
| 426 | 426 | k037122_device *k037122 = get_cgboard_id() ? m_k037122_2 : m_k037122_1; |
| 427 | | k037122_char_w(k037122, space, offset, data, mem_mask); |
| 427 | k037122->char_w(space, offset, data, mem_mask); |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | READ32_MEMBER(hornet_state::hornet_k037122_reg_r) |
| 431 | 431 | { |
| 432 | 432 | k037122_device *k037122 = get_cgboard_id() ? m_k037122_2 : m_k037122_1; |
| 433 | | return k037122_reg_r(k037122, space, offset, mem_mask); |
| 433 | return k037122->reg_r(space, offset, mem_mask); |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | WRITE32_MEMBER(hornet_state::hornet_k037122_reg_w) |
| 437 | 437 | { |
| 438 | 438 | k037122_device *k037122 = get_cgboard_id() ? m_k037122_2 : m_k037122_1; |
| 439 | | k037122_reg_w(k037122, space, offset, data, mem_mask); |
| 439 | k037122->reg_w(space, offset, data, mem_mask); |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | WRITE_LINE_MEMBER(hornet_state::voodoo_vblank_0) |
| r24046 | r24047 | |
| 454 | 454 | |
| 455 | 455 | voodoo_update(voodoo, bitmap, cliprect); |
| 456 | 456 | |
| 457 | | k037122_tile_draw(m_k037122_1, bitmap, cliprect); |
| 457 | m_k037122_1->tile_draw(bitmap, cliprect); |
| 458 | 458 | |
| 459 | 459 | draw_7segment_led(bitmap, 3, 3, m_led_reg0); |
| 460 | 460 | draw_7segment_led(bitmap, 9, 3, m_led_reg1); |
| r24046 | r24047 | |
| 469 | 469 | voodoo_update(voodoo, bitmap, cliprect); |
| 470 | 470 | |
| 471 | 471 | /* TODO: tilemaps per screen */ |
| 472 | | k037122_tile_draw(m_k037122_1, bitmap, cliprect); |
| 472 | m_k037122_1->tile_draw(bitmap, cliprect); |
| 473 | 473 | } |
| 474 | 474 | else if (strcmp(screen.tag(), ":rscreen") == 0) |
| 475 | 475 | { |
| r24046 | r24047 | |
| 477 | 477 | voodoo_update(voodoo, bitmap, cliprect); |
| 478 | 478 | |
| 479 | 479 | /* TODO: tilemaps per screen */ |
| 480 | | k037122_tile_draw(m_k037122_2, bitmap, cliprect); |
| 480 | m_k037122_2->tile_draw(bitmap, cliprect); |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | draw_7segment_led(bitmap, 3, 3, m_led_reg0); |
trunk/src/mame/video/konicdev.c
| r24046 | r24047 | |
| 10609 | 10609 | /* */ |
| 10610 | 10610 | /***************************************************************************/ |
| 10611 | 10611 | |
| 10612 | | struct k037122_state |
| 10613 | | { |
| 10614 | | screen_device *screen; |
| 10615 | | tilemap_t *layer[2]; |
| 10616 | | int gfx_index; |
| 10617 | | |
| 10618 | | UINT32 * tile_ram; |
| 10619 | | UINT32 * char_ram; |
| 10620 | | UINT32 * reg; |
| 10621 | | }; |
| 10622 | | |
| 10623 | | |
| 10624 | 10612 | #define K037122_NUM_TILES 16384 |
| 10625 | 10613 | |
| 10626 | | /***************************************************************************** |
| 10627 | | INLINE FUNCTIONS |
| 10628 | | *****************************************************************************/ |
| 10614 | const device_type K037122 = &device_creator<k037122_device>; |
| 10629 | 10615 | |
| 10630 | | INLINE k037122_state *k037122_get_safe_token( device_t *device ) |
| 10616 | k037122_device::k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 10617 | : device_t(mconfig, K037122, "Konami 0371222", tag, owner, clock, "k037122", __FILE__), |
| 10618 | m_screen(NULL), |
| 10619 | m_tile_ram(NULL), |
| 10620 | m_char_ram(NULL), |
| 10621 | m_reg(NULL) |
| 10631 | 10622 | { |
| 10632 | | assert(device != NULL); |
| 10633 | | assert(device->type() == K037122); |
| 10634 | | |
| 10635 | | return (k037122_state *)downcast<k037122_device *>(device)->token(); |
| 10636 | 10623 | } |
| 10637 | 10624 | |
| 10638 | | INLINE const k037122_interface *k037122_get_interface( device_t *device ) |
| 10625 | //------------------------------------------------- |
| 10626 | // device_config_complete - perform any |
| 10627 | // operations now that the configuration is |
| 10628 | // complete |
| 10629 | //------------------------------------------------- |
| 10630 | |
| 10631 | void k037122_device::device_config_complete() |
| 10639 | 10632 | { |
| 10640 | | assert(device != NULL); |
| 10641 | | assert((device->type() == K037122)); |
| 10642 | | return (const k037122_interface *) device->static_config(); |
| 10633 | // inherit a copy of the static data |
| 10634 | const k037122_interface *intf = reinterpret_cast<const k037122_interface *>(static_config()); |
| 10635 | if (intf != NULL) |
| 10636 | *static_cast<k037122_interface *>(this) = *intf; |
| 10637 | |
| 10638 | // or initialize to defaults if none provided |
| 10639 | else |
| 10640 | { |
| 10641 | m_screen_tag = ""; |
| 10642 | m_gfx_index = 0; |
| 10643 | } |
| 10643 | 10644 | } |
| 10644 | 10645 | |
| 10645 | | /***************************************************************************** |
| 10646 | | DEVICE HANDLERS |
| 10647 | | *****************************************************************************/ |
| 10646 | //------------------------------------------------- |
| 10647 | // device_start - device-specific startup |
| 10648 | //------------------------------------------------- |
| 10648 | 10649 | |
| 10649 | | static const gfx_layout k037122_char_layout = |
| 10650 | void k037122_device::device_start() |
| 10650 | 10651 | { |
| 10652 | static const gfx_layout k037122_char_layout = |
| 10653 | { |
| 10651 | 10654 | 8, 8, |
| 10652 | 10655 | K037122_NUM_TILES, |
| 10653 | 10656 | 8, |
| r24046 | r24047 | |
| 10655 | 10658 | { 1*16, 0*16, 3*16, 2*16, 5*16, 4*16, 7*16, 6*16 }, |
| 10656 | 10659 | { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128 }, |
| 10657 | 10660 | 8*128 |
| 10658 | | }; |
| 10661 | }; |
| 10662 | |
| 10663 | m_screen = machine().device<screen_device>(m_screen_tag); |
| 10664 | |
| 10665 | m_char_ram = auto_alloc_array_clear(machine(), UINT32, 0x200000 / 4); |
| 10666 | m_tile_ram = auto_alloc_array_clear(machine(), UINT32, 0x20000 / 4); |
| 10667 | m_reg = auto_alloc_array_clear(machine(), UINT32, 0x400 / 4); |
| 10659 | 10668 | |
| 10660 | | TILE_GET_INFO_MEMBER(k037122_device::k037122_tile_info_layer0) |
| 10669 | m_layer[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k037122_device::tile_info_layer0),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64); |
| 10670 | m_layer[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k037122_device::tile_info_layer1),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); |
| 10671 | |
| 10672 | m_layer[0]->set_transparent_pen(0); |
| 10673 | m_layer[1]->set_transparent_pen(0); |
| 10674 | |
| 10675 | machine().gfx[m_gfx_index] = auto_alloc_clear(machine(), gfx_element(machine(), k037122_char_layout, (UINT8*)m_char_ram, machine().total_colors() / 16, 0)); |
| 10676 | |
| 10677 | save_pointer(NAME(m_reg), 0x400 / 4); |
| 10678 | save_pointer(NAME(m_char_ram), 0x200000 / 4); |
| 10679 | save_pointer(NAME(m_tile_ram), 0x20000 / 4); |
| 10680 | |
| 10681 | } |
| 10682 | |
| 10683 | //------------------------------------------------- |
| 10684 | // device_reset - device-specific reset |
| 10685 | //------------------------------------------------- |
| 10686 | |
| 10687 | void k037122_device::device_reset() |
| 10661 | 10688 | { |
| 10662 | | k037122_state *k037122 = k037122_get_safe_token(this); |
| 10663 | | UINT32 val = k037122->tile_ram[tile_index + (0x8000/4)]; |
| 10689 | memset(m_char_ram, 0, 0x200000); |
| 10690 | memset(m_tile_ram, 0, 0x20000); |
| 10691 | memset(m_reg, 0, 0x400); |
| 10692 | } |
| 10693 | |
| 10694 | /***************************************************************************** |
| 10695 | DEVICE HANDLERS |
| 10696 | *****************************************************************************/ |
| 10697 | |
| 10698 | TILE_GET_INFO_MEMBER(k037122_device::tile_info_layer0) |
| 10699 | { |
| 10700 | UINT32 val = m_tile_ram[tile_index + (0x8000/4)]; |
| 10664 | 10701 | int color = (val >> 17) & 0x1f; |
| 10665 | 10702 | int tile = val & 0x3fff; |
| 10666 | 10703 | int flags = 0; |
| r24046 | r24047 | |
| 10670 | 10707 | if (val & 0x800000) |
| 10671 | 10708 | flags |= TILE_FLIPY; |
| 10672 | 10709 | |
| 10673 | | SET_TILE_INFO_MEMBER(k037122->gfx_index, tile, color, flags); |
| 10710 | SET_TILE_INFO_MEMBER(m_gfx_index, tile, color, flags); |
| 10674 | 10711 | } |
| 10675 | 10712 | |
| 10676 | | TILE_GET_INFO_MEMBER(k037122_device::k037122_tile_info_layer1) |
| 10713 | TILE_GET_INFO_MEMBER(k037122_device::tile_info_layer1) |
| 10677 | 10714 | { |
| 10678 | | k037122_state *k037122 = k037122_get_safe_token(this); |
| 10679 | | UINT32 val = k037122->tile_ram[tile_index]; |
| 10715 | UINT32 val = m_tile_ram[tile_index]; |
| 10680 | 10716 | int color = (val >> 17) & 0x1f; |
| 10681 | 10717 | int tile = val & 0x3fff; |
| 10682 | 10718 | int flags = 0; |
| r24046 | r24047 | |
| 10686 | 10722 | if (val & 0x800000) |
| 10687 | 10723 | flags |= TILE_FLIPY; |
| 10688 | 10724 | |
| 10689 | | SET_TILE_INFO_MEMBER(k037122->gfx_index, tile, color, flags); |
| 10725 | SET_TILE_INFO_MEMBER(m_gfx_index, tile, color, flags); |
| 10690 | 10726 | } |
| 10691 | 10727 | |
| 10692 | 10728 | |
| 10693 | | void k037122_tile_draw( device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect ) |
| 10729 | void k037122_device::tile_draw( bitmap_rgb32 &bitmap, const rectangle &cliprect ) |
| 10694 | 10730 | { |
| 10695 | | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10696 | | const rectangle &visarea = k037122->screen->visible_area(); |
| 10731 | const rectangle &visarea = m_screen->visible_area(); |
| 10697 | 10732 | |
| 10698 | | if (k037122->reg[0xc] & 0x10000) |
| 10733 | if (m_reg[0xc] & 0x10000) |
| 10699 | 10734 | { |
| 10700 | | k037122->layer[1]->set_scrolldx(visarea.min_x, visarea.min_x); |
| 10701 | | k037122->layer[1]->set_scrolldy(visarea.min_y, visarea.min_y); |
| 10702 | | k037122->layer[1]->draw(bitmap, cliprect, 0, 0); |
| 10735 | m_layer[1]->set_scrolldx(visarea.min_x, visarea.min_x); |
| 10736 | m_layer[1]->set_scrolldy(visarea.min_y, visarea.min_y); |
| 10737 | m_layer[1]->draw(bitmap, cliprect, 0, 0); |
| 10703 | 10738 | } |
| 10704 | 10739 | else |
| 10705 | 10740 | { |
| 10706 | | k037122->layer[0]->set_scrolldx(visarea.min_x, visarea.min_x); |
| 10707 | | k037122->layer[0]->set_scrolldy(visarea.min_y, visarea.min_y); |
| 10708 | | k037122->layer[0]->draw(bitmap, cliprect, 0, 0); |
| 10741 | m_layer[0]->set_scrolldx(visarea.min_x, visarea.min_x); |
| 10742 | m_layer[0]->set_scrolldy(visarea.min_y, visarea.min_y); |
| 10743 | m_layer[0]->draw(bitmap, cliprect, 0, 0); |
| 10709 | 10744 | } |
| 10710 | 10745 | } |
| 10711 | 10746 | |
| 10712 | | static void update_palette_color( device_t *device, UINT32 palette_base, int color ) |
| 10747 | void k037122_device::update_palette_color( UINT32 palette_base, int color ) |
| 10713 | 10748 | { |
| 10714 | | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10715 | | UINT32 data = k037122->tile_ram[(palette_base / 4) + color]; |
| 10749 | UINT32 data = m_tile_ram[(palette_base / 4) + color]; |
| 10716 | 10750 | |
| 10717 | | palette_set_color_rgb(device->machine(), color, pal5bit(data >> 6), pal6bit(data >> 0), pal5bit(data >> 11)); |
| 10751 | palette_set_color_rgb(machine(), color, pal5bit(data >> 6), pal6bit(data >> 0), pal5bit(data >> 11)); |
| 10718 | 10752 | } |
| 10719 | 10753 | |
| 10720 | | READ32_DEVICE_HANDLER( k037122_sram_r ) |
| 10754 | READ32_MEMBER( k037122_device::sram_r ) |
| 10721 | 10755 | { |
| 10722 | | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10723 | | |
| 10724 | | return k037122->tile_ram[offset]; |
| 10756 | return m_tile_ram[offset]; |
| 10725 | 10757 | } |
| 10726 | 10758 | |
| 10727 | | WRITE32_DEVICE_HANDLER( k037122_sram_w ) |
| 10759 | WRITE32_MEMBER( k037122_device::sram_w ) |
| 10728 | 10760 | { |
| 10729 | | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10761 | COMBINE_DATA(m_tile_ram + offset); |
| 10730 | 10762 | |
| 10731 | | COMBINE_DATA(k037122->tile_ram + offset); |
| 10732 | | |
| 10733 | | if (k037122->reg[0xc] & 0x10000) |
| 10763 | if (m_reg[0xc] & 0x10000) |
| 10734 | 10764 | { |
| 10735 | 10765 | if (offset < 0x8000 / 4) |
| 10736 | 10766 | { |
| 10737 | | k037122->layer[1]->mark_tile_dirty(offset); |
| 10767 | m_layer[1]->mark_tile_dirty(offset); |
| 10738 | 10768 | } |
| 10739 | 10769 | else if (offset >= 0x8000 / 4 && offset < 0x18000 / 4) |
| 10740 | 10770 | { |
| 10741 | | k037122->layer[0]->mark_tile_dirty(offset - (0x8000 / 4)); |
| 10771 | m_layer[0]->mark_tile_dirty(offset - (0x8000 / 4)); |
| 10742 | 10772 | } |
| 10743 | 10773 | else if (offset >= 0x18000 / 4) |
| 10744 | 10774 | { |
| 10745 | | update_palette_color(device, 0x18000, offset - (0x18000 / 4)); |
| 10775 | update_palette_color(0x18000, offset - (0x18000 / 4)); |
| 10746 | 10776 | } |
| 10747 | 10777 | } |
| 10748 | 10778 | else |
| 10749 | 10779 | { |
| 10750 | 10780 | if (offset < 0x8000 / 4) |
| 10751 | 10781 | { |
| 10752 | | update_palette_color(device, 0, offset); |
| 10782 | update_palette_color(0, offset); |
| 10753 | 10783 | } |
| 10754 | 10784 | else if (offset >= 0x8000 / 4 && offset < 0x18000 / 4) |
| 10755 | 10785 | { |
| 10756 | | k037122->layer[0]->mark_tile_dirty(offset - (0x8000 / 4)); |
| 10786 | m_layer[0]->mark_tile_dirty(offset - (0x8000 / 4)); |
| 10757 | 10787 | } |
| 10758 | 10788 | else if (offset >= 0x18000 / 4) |
| 10759 | 10789 | { |
| 10760 | | k037122->layer[1]->mark_tile_dirty(offset - (0x18000 / 4)); |
| 10790 | m_layer[1]->mark_tile_dirty(offset - (0x18000 / 4)); |
| 10761 | 10791 | } |
| 10762 | 10792 | } |
| 10763 | 10793 | } |
| 10764 | 10794 | |
| 10765 | 10795 | |
| 10766 | | READ32_DEVICE_HANDLER( k037122_char_r ) |
| 10796 | READ32_MEMBER( k037122_device::char_r ) |
| 10767 | 10797 | { |
| 10768 | | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10769 | | int bank = k037122->reg[0x30 / 4] & 0x7; |
| 10798 | int bank = m_reg[0x30 / 4] & 0x7; |
| 10770 | 10799 | |
| 10771 | | return k037122->char_ram[offset + (bank * (0x40000 / 4))]; |
| 10800 | return m_char_ram[offset + (bank * (0x40000 / 4))]; |
| 10772 | 10801 | } |
| 10773 | 10802 | |
| 10774 | | WRITE32_DEVICE_HANDLER( k037122_char_w ) |
| 10803 | WRITE32_MEMBER( k037122_device::char_w ) |
| 10775 | 10804 | { |
| 10776 | | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10777 | | int bank = k037122->reg[0x30 / 4] & 0x7; |
| 10805 | int bank = m_reg[0x30 / 4] & 0x7; |
| 10778 | 10806 | UINT32 addr = offset + (bank * (0x40000/4)); |
| 10779 | 10807 | |
| 10780 | | COMBINE_DATA(k037122->char_ram + addr); |
| 10781 | | space.machine().gfx[k037122->gfx_index]->mark_dirty(addr / 32); |
| 10808 | COMBINE_DATA(m_char_ram + addr); |
| 10809 | space.machine().gfx[m_gfx_index]->mark_dirty(addr / 32); |
| 10782 | 10810 | } |
| 10783 | 10811 | |
| 10784 | | READ32_DEVICE_HANDLER( k037122_reg_r ) |
| 10812 | READ32_MEMBER( k037122_device::reg_r ) |
| 10785 | 10813 | { |
| 10786 | | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10787 | | |
| 10788 | 10814 | switch (offset) |
| 10789 | 10815 | { |
| 10790 | 10816 | case 0x14/4: |
| r24046 | r24047 | |
| 10792 | 10818 | return 0x000003fa; |
| 10793 | 10819 | } |
| 10794 | 10820 | } |
| 10795 | | return k037122->reg[offset]; |
| 10821 | return m_reg[offset]; |
| 10796 | 10822 | } |
| 10797 | 10823 | |
| 10798 | | WRITE32_DEVICE_HANDLER( k037122_reg_w ) |
| 10824 | WRITE32_MEMBER( k037122_device::reg_w ) |
| 10799 | 10825 | { |
| 10800 | | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10801 | | |
| 10802 | | COMBINE_DATA(k037122->reg + offset); |
| 10826 | COMBINE_DATA(m_reg + offset); |
| 10803 | 10827 | } |
| 10804 | 10828 | |
| 10805 | | /***************************************************************************** |
| 10806 | | DEVICE INTERFACE |
| 10807 | | *****************************************************************************/ |
| 10808 | 10829 | |
| 10809 | | const device_type K037122 = &device_creator<k037122_device>; |
| 10810 | | |
| 10811 | | k037122_device::k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 10812 | | : device_t(mconfig, K037122, "Konami 0371222", tag, owner, clock, "k037122", __FILE__) |
| 10813 | | { |
| 10814 | | m_token = global_alloc_clear(k037122_state); |
| 10815 | | } |
| 10816 | | |
| 10817 | | //------------------------------------------------- |
| 10818 | | // device_config_complete - perform any |
| 10819 | | // operations now that the configuration is |
| 10820 | | // complete |
| 10821 | | //------------------------------------------------- |
| 10822 | | |
| 10823 | | void k037122_device::device_config_complete() |
| 10824 | | { |
| 10825 | | } |
| 10826 | | |
| 10827 | | //------------------------------------------------- |
| 10828 | | // device_start - device-specific startup |
| 10829 | | //------------------------------------------------- |
| 10830 | | |
| 10831 | | void k037122_device::device_start() |
| 10832 | | { |
| 10833 | | k037122_state *k037122 = k037122_get_safe_token(this); |
| 10834 | | const k037122_interface *intf = k037122_get_interface(this); |
| 10835 | | |
| 10836 | | k037122->screen = machine().device<screen_device>(intf->screen); |
| 10837 | | k037122->gfx_index = intf->gfx_index; |
| 10838 | | |
| 10839 | | k037122->char_ram = auto_alloc_array(machine(), UINT32, 0x200000 / 4); |
| 10840 | | k037122->tile_ram = auto_alloc_array(machine(), UINT32, 0x20000 / 4); |
| 10841 | | k037122->reg = auto_alloc_array(machine(), UINT32, 0x400 / 4); |
| 10842 | | |
| 10843 | | k037122->layer[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k037122_device::k037122_tile_info_layer0),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64); |
| 10844 | | k037122->layer[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k037122_device::k037122_tile_info_layer1),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); |
| 10845 | | |
| 10846 | | k037122->layer[0]->set_transparent_pen(0); |
| 10847 | | k037122->layer[1]->set_transparent_pen(0); |
| 10848 | | |
| 10849 | | machine().gfx[k037122->gfx_index] = auto_alloc(machine(), gfx_element(machine(), k037122_char_layout, (UINT8*)k037122->char_ram, machine().total_colors() / 16, 0)); |
| 10850 | | |
| 10851 | | save_pointer(NAME(k037122->reg), 0x400 / 4); |
| 10852 | | save_pointer(NAME(k037122->char_ram), 0x200000 / 4); |
| 10853 | | save_pointer(NAME(k037122->tile_ram), 0x20000 / 4); |
| 10854 | | |
| 10855 | | } |
| 10856 | | |
| 10857 | | //------------------------------------------------- |
| 10858 | | // device_reset - device-specific reset |
| 10859 | | //------------------------------------------------- |
| 10860 | | |
| 10861 | | void k037122_device::device_reset() |
| 10862 | | { |
| 10863 | | k037122_state *k037122 = k037122_get_safe_token(this); |
| 10864 | | |
| 10865 | | memset(k037122->char_ram, 0, 0x200000); |
| 10866 | | memset(k037122->tile_ram, 0, 0x20000); |
| 10867 | | memset(k037122->reg, 0, 0x400); |
| 10868 | | } |
| 10869 | | |
| 10870 | | |
| 10871 | 10830 | /***************************************************************************/ |
| 10872 | 10831 | /* */ |
| 10873 | 10832 | /* misc debug handlers */ |