diff options
Diffstat (limited to 'src/mame/machine/315-5881_crypt.h')
-rw-r--r-- | src/mame/machine/315-5881_crypt.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/mame/machine/315-5881_crypt.h b/src/mame/machine/315-5881_crypt.h index feacc5ce3e9..109ec4c23b9 100644 --- a/src/mame/machine/315-5881_crypt.h +++ b/src/mame/machine/315-5881_crypt.h @@ -6,7 +6,7 @@ #ifndef __SEGA315_5881_CRYPT__ #define __SEGA315_5881_CRYPT__ -typedef device_delegate<UINT16 (UINT32)> sega_m2_read_delegate; +typedef device_delegate<uint16_t (uint32_t)> sega_m2_read_delegate; extern const device_type SEGA315_5881_CRYPT; @@ -18,13 +18,13 @@ class sega_315_5881_crypt_device : public device_t { public: // construction/destruction - sega_315_5881_crypt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5881_crypt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT16 do_decrypt(UINT8 *&base); - void set_addr_low(UINT16 data); - void set_addr_high(UINT16 data); - void set_subkey(UINT16 data); + uint16_t do_decrypt(uint8_t *&base); + void set_addr_low(uint16_t data); + void set_addr_high(uint16_t data); + void set_subkey(uint16_t data); sega_m2_read_delegate m_read; @@ -46,20 +46,20 @@ private: FLAG_COMPRESSED = 0x20000 }; - UINT32 key; + uint32_t key; - std::unique_ptr<UINT8[]> buffer; - std::unique_ptr<UINT8[]> line_buffer; - std::unique_ptr<UINT8[]> line_buffer_prev; - UINT32 prot_cur_address; - UINT16 subkey, dec_hist; - UINT32 dec_header; + std::unique_ptr<uint8_t[]> buffer; + std::unique_ptr<uint8_t[]> line_buffer; + std::unique_ptr<uint8_t[]> line_buffer_prev; + uint32_t prot_cur_address; + uint16_t subkey, dec_hist; + uint32_t dec_header; bool enc_ready; int buffer_pos, line_buffer_pos, line_buffer_size, buffer_bit, buffer_bit2; - UINT8 buffer2[2]; - UINT16 buffer2a; + uint8_t buffer2[2]; + uint16_t buffer2a; int block_size; int block_pos; @@ -67,7 +67,7 @@ private: int done_compression; struct sbox { - UINT8 table[64]; + uint8_t table[64]; int inputs[6]; // positions of the inputs bits, -1 means no input except from key int outputs[2]; // positions of the output bits }; @@ -83,12 +83,12 @@ private: static const int fn2_sequence_key_scheduling[16]; static const int fn2_middle_result_scheduling[16]; - static const UINT8 trees[9][2][32]; + static const uint8_t trees[9][2][32]; - int feistel_function(int input, const struct sbox *sboxes, UINT32 subkeys); - UINT16 block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data); + int feistel_function(int input, const struct sbox *sboxes, uint32_t subkeys); + uint16_t block_decrypt(uint32_t game_key, uint16_t sequence_key, uint16_t counter, uint16_t data); - UINT16 get_decrypted_16(); + uint16_t get_decrypted_16(); int get_compressed_bit(); void enc_start(); |