Previous 199869 Revisions Next

r33187 Tuesday 4th November, 2014 at 00:44:41 UTC by R. Belmont
fix non-Windows compile (nw)
[src/mame/drivers]stv.c
[src/mame/includes]stv.h
[src/mame/machine]315-5881_crypt.c 315-5881_crypt.h stvprot.c
[src/mess/drivers]px4.c

trunk/src/mame/drivers/stv.c
r241698r241699
10231023   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
10241024
10251025   MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0)
1026   MCFG_SET_READ_CALLBACK(stv_state, crypt_read_callback)
1026   //MCFG_SET_READ_CALLBACK(stv_state, read_callback)
10271027MACHINE_CONFIG_END
10281028
10291029/*
trunk/src/mame/includes/stv.h
r241698r241699
3535         m_cart3(*this, "stv_slot3"),
3636         m_cart4(*this, "stv_slot4"),
3737         m_gfxdecode(*this, "gfxdecode"),
38         m_palette(*this, "palette")
38         m_palette(*this, "palette"),
39         m_cryptdevice(*this, "315_5881")
3940   {
4041   }
4142
r241698r241699
169170   required_device<gfxdecode_device> m_gfxdecode;
170171   required_device<palette_device> m_palette;
171172
173   optional_device<sega_315_5881_crypt_device> m_cryptdevice;
172174
173175
174176   bitmap_rgb32 m_tmpbitmap;
r241698r241699
698700   stv_state(const machine_config &mconfig, device_type type, const char *tag)
699701      : saturn_state(mconfig, type, tag),
700702      m_adsp(*this, "adsp"),
701      m_adsp_pram(*this, "adsp_pram"),
702      m_cryptdevice(*this, "315_5881")
703      m_adsp_pram(*this, "adsp_pram")
703704   {
704705   }
705706
r241698r241699
834835   DECLARE_WRITE32_MEMBER( decathlt_prot2_w );
835836   void write_prot_data(UINT32 data, UINT32 mem_mask, int offset, int which);
836837   void install_decathlt_protection();
837
838   optional_device<sega_315_5881_crypt_device> m_cryptdevice;
839   UINT16 crypt_read_callback(UINT32 addr);
840838};
841839
842840
trunk/src/mame/machine/315-5881_crypt.c
r241698r241699
6565   buffer_bit = 0;
6666}
6767
68UINT16 sega_315_5881_crypt_device::do_decrypt(UINT8 *&base)
68void sega_315_5881_crypt_device::do_decrypt(UINT8 *&base)
6969{
7070   if(!enc_ready)
7171      enc_start();
r241698r241699
8080      base = buffer + buffer_pos;
8181      buffer_pos += 2;
8282   }
83
84   return (base[0] << 8) | base[1];
8583}
8684
8785void sega_315_5881_crypt_device::set_addr_low(UINT16 data)
trunk/src/mame/machine/315-5881_crypt.h
r241698r241699
1919   sega_315_5881_crypt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2020   
2121
22   UINT16 do_decrypt(UINT8 *&base);
22   void do_decrypt(UINT8 *&base);
2323   void set_addr_low(UINT16 data);
2424   void set_addr_high(UINT16 data);
2525   void set_subkey(UINT16 data);
trunk/src/mame/machine/stvprot.c
r241698r241699
590590
591591         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);
592592
593         //UINT16 res = m_cryptdevice->do_decrypt(base);
594
595593         m_ctrl_index += 4;
596594         return retdata;
597595
r241698r241699
606604}
607605
608606
609UINT16 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}
614607
608
615609WRITE32_MEMBER ( stv_state::common_prot_w )
616610{
617611   COMBINE_DATA(&m_a_bus[offset]);
r241698r241699
633627   {
634628      COMBINE_DATA(&m_abus_protkey);
635629
636      m_cryptdevice->set_subkey(m_abus_protkey>>16);
630      m_cryptdevice->set_subkey(m_abus_protkey);
637631
638632
639633      int a_bus_vector;
r241698r241699
671665{
672666   install_common_protection();
673667   m_prot_readback = astrass_prot_read_callback;
674//   m_cryptdevice->set_key(0x00000000);
675668}
676669
677670void stv_state::install_ffreveng_protection()
trunk/src/mess/drivers/px4.c
r241698r241699
590590   // writing clock?
591591   if (m_clock_state > 0)
592592   {
593      struct tm *t = localtime(&m_time.time);
593      struct tm *t = localtime((const long int *)&m_time.time);
594594
595595      switch (m_clock_state++)
596596      {


Previous 199869 Revisions Next


© 1997-2024 The MAME Team