trunk/src/mame/includes/stv.h
| r241700 | r241701 | |
| 35 | 35 | m_cart3(*this, "stv_slot3"), |
| 36 | 36 | m_cart4(*this, "stv_slot4"), |
| 37 | 37 | m_gfxdecode(*this, "gfxdecode"), |
| 38 | | m_palette(*this, "palette"), |
| 39 | | m_cryptdevice(*this, "315_5881") |
| 38 | m_palette(*this, "palette") |
| 40 | 39 | { |
| 41 | 40 | } |
| 42 | 41 | |
| r241700 | r241701 | |
| 170 | 169 | required_device<gfxdecode_device> m_gfxdecode; |
| 171 | 170 | required_device<palette_device> m_palette; |
| 172 | 171 | |
| 173 | | optional_device<sega_315_5881_crypt_device> m_cryptdevice; |
| 174 | 172 | |
| 175 | 173 | |
| 176 | 174 | bitmap_rgb32 m_tmpbitmap; |
| r241700 | r241701 | |
| 700 | 698 | stv_state(const machine_config &mconfig, device_type type, const char *tag) |
| 701 | 699 | : saturn_state(mconfig, type, tag), |
| 702 | 700 | m_adsp(*this, "adsp"), |
| 703 | | m_adsp_pram(*this, "adsp_pram") |
| 701 | m_adsp_pram(*this, "adsp_pram"), |
| 702 | m_cryptdevice(*this, "315_5881") |
| 704 | 703 | { |
| 705 | 704 | } |
| 706 | 705 | |
| r241700 | r241701 | |
| 835 | 834 | DECLARE_WRITE32_MEMBER( decathlt_prot2_w ); |
| 836 | 835 | void write_prot_data(UINT32 data, UINT32 mem_mask, int offset, int which); |
| 837 | 836 | void install_decathlt_protection(); |
| 837 | |
| 838 | optional_device<sega_315_5881_crypt_device> m_cryptdevice; |
| 839 | UINT16 crypt_read_callback(UINT32 addr); |
| 838 | 840 | }; |
| 839 | 841 | |
| 840 | 842 | |
trunk/src/mame/machine/stvprot.c
| r241700 | r241701 | |
| 590 | 590 | |
| 591 | 591 | logerror("A-Bus control protection read at %06x with data = %08x Returning = %08x Would otherwise return = %08x\n",space.device().safe_pc(),m_abus_protkey, retdata, realret); |
| 592 | 592 | |
| 593 | //UINT16 res = m_cryptdevice->do_decrypt(base); |
| 594 | |
| 593 | 595 | m_ctrl_index += 4; |
| 594 | 596 | return retdata; |
| 595 | 597 | |
| r241700 | r241701 | |
| 604 | 606 | } |
| 605 | 607 | |
| 606 | 608 | |
| 609 | UINT16 stv_state::crypt_read_callback(UINT32 addr) |
| 610 | { |
| 611 | const UINT8 *base = m_cart_reg[0]->base() + 2*addr; |
| 612 | return base[1] | (base[0] << 8); |
| 613 | } |
| 607 | 614 | |
| 608 | | |
| 609 | 615 | WRITE32_MEMBER ( stv_state::common_prot_w ) |
| 610 | 616 | { |
| 611 | 617 | COMBINE_DATA(&m_a_bus[offset]); |
| r241700 | r241701 | |
| 627 | 633 | { |
| 628 | 634 | COMBINE_DATA(&m_abus_protkey); |
| 629 | 635 | |
| 630 | | m_cryptdevice->set_subkey(m_abus_protkey); |
| 636 | m_cryptdevice->set_subkey(m_abus_protkey>>16); |
| 631 | 637 | |
| 632 | 638 | |
| 633 | 639 | int a_bus_vector; |
| r241700 | r241701 | |
| 665 | 671 | { |
| 666 | 672 | install_common_protection(); |
| 667 | 673 | m_prot_readback = astrass_prot_read_callback; |
| 674 | // m_cryptdevice->set_key(0x00000000); |
| 668 | 675 | } |
| 669 | 676 | |
| 670 | 677 | void stv_state::install_ffreveng_protection() |