trunk/src/mame/includes/stv.h
r241698 | r241699 | |
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") |
| 38 | m_palette(*this, "palette"), |
| 39 | m_cryptdevice(*this, "315_5881") |
39 | 40 | { |
40 | 41 | } |
41 | 42 | |
r241698 | r241699 | |
169 | 170 | required_device<gfxdecode_device> m_gfxdecode; |
170 | 171 | required_device<palette_device> m_palette; |
171 | 172 | |
| 173 | optional_device<sega_315_5881_crypt_device> m_cryptdevice; |
172 | 174 | |
173 | 175 | |
174 | 176 | bitmap_rgb32 m_tmpbitmap; |
r241698 | r241699 | |
698 | 700 | stv_state(const machine_config &mconfig, device_type type, const char *tag) |
699 | 701 | : saturn_state(mconfig, type, tag), |
700 | 702 | m_adsp(*this, "adsp"), |
701 | | m_adsp_pram(*this, "adsp_pram"), |
702 | | m_cryptdevice(*this, "315_5881") |
| 703 | m_adsp_pram(*this, "adsp_pram") |
703 | 704 | { |
704 | 705 | } |
705 | 706 | |
r241698 | r241699 | |
834 | 835 | DECLARE_WRITE32_MEMBER( decathlt_prot2_w ); |
835 | 836 | void write_prot_data(UINT32 data, UINT32 mem_mask, int offset, int which); |
836 | 837 | void install_decathlt_protection(); |
837 | | |
838 | | optional_device<sega_315_5881_crypt_device> m_cryptdevice; |
839 | | UINT16 crypt_read_callback(UINT32 addr); |
840 | 838 | }; |
841 | 839 | |
842 | 840 | |
trunk/src/mame/machine/stvprot.c
r241698 | r241699 | |
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 | | |
595 | 593 | m_ctrl_index += 4; |
596 | 594 | return retdata; |
597 | 595 | |
r241698 | r241699 | |
606 | 604 | } |
607 | 605 | |
608 | 606 | |
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 | | } |
614 | 607 | |
| 608 | |
615 | 609 | WRITE32_MEMBER ( stv_state::common_prot_w ) |
616 | 610 | { |
617 | 611 | COMBINE_DATA(&m_a_bus[offset]); |
r241698 | r241699 | |
633 | 627 | { |
634 | 628 | COMBINE_DATA(&m_abus_protkey); |
635 | 629 | |
636 | | m_cryptdevice->set_subkey(m_abus_protkey>>16); |
| 630 | m_cryptdevice->set_subkey(m_abus_protkey); |
637 | 631 | |
638 | 632 | |
639 | 633 | int a_bus_vector; |
r241698 | r241699 | |
671 | 665 | { |
672 | 666 | install_common_protection(); |
673 | 667 | m_prot_readback = astrass_prot_read_callback; |
674 | | // m_cryptdevice->set_key(0x00000000); |
675 | 668 | } |
676 | 669 | |
677 | 670 | void stv_state::install_ffreveng_protection() |