~ubuntu-branches/ubuntu/precise/mame/precise-proposed

« back to all changes in this revision

Viewing changes to src/mame/machine/naomigd.h

  • Committer: Package Import Robot
  • Author(s): Cesare Falco
  • Date: 2011-11-30 18:50:10 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111130185010-02hcxybht1mn082w
Tags: 0.144-0ubuntu1
* New upstream release (LP: #913550)
* mame.install:
  - Added artwork/ images to be used with -effect switch
  - Be more selective with hash/ contents
* contrib/mame.ini: added /usr/share/games/mame/artwork/ to artpath

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _NAOMIGD_H_
 
2
#define _NAOMIGD_H_
 
3
 
 
4
#include "naomibd.h"
 
5
 
 
6
#define MCFG_NAOMI_GDROM_BOARD_ADD(_tag, _image_tag, _pic_tag, _eeprom_tag, _maincpu_tag, _irq_cb) \
 
7
        MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_GDROM_BOARD, _eeprom_tag, _maincpu_tag, _irq_cb) \
 
8
        naomi_gdrom_board::static_set_tags(*device, _image_tag, _pic_tag);
 
9
 
 
10
class naomi_gdrom_board : public naomi_board
 
11
{
 
12
public:
 
13
        naomi_gdrom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
 
14
 
 
15
        static void static_set_tags(device_t &device, const char *_image_tag, const char *_pic_tag);
 
16
 
 
17
protected:
 
18
        virtual void device_start();
 
19
        virtual void device_reset();
 
20
 
 
21
        virtual void board_setup_address(UINT32 address, bool is_dma);
 
22
        virtual void board_get_buffer(UINT8 *&base, UINT32 &limit);
 
23
        virtual void board_advance(UINT32 size);
 
24
 
 
25
private:
 
26
        enum { FILENAME_LENGTH=24 };
 
27
 
 
28
        const char *image_tag, *pic_tag;
 
29
 
 
30
        UINT32 dimm_cur_address;
 
31
 
 
32
        // Note: voluntarily not saved into the state
 
33
        UINT8 *dimm_data;
 
34
        UINT32 dimm_data_size;
 
35
 
 
36
        static const UINT32 DES_LEFTSWAP[];
 
37
        static const UINT32 DES_RIGHTSWAP[];
 
38
        static const UINT32 DES_SBOX1[];
 
39
        static const UINT32 DES_SBOX2[];
 
40
        static const UINT32 DES_SBOX3[];
 
41
        static const UINT32 DES_SBOX4[];
 
42
        static const UINT32 DES_SBOX5[];
 
43
        static const UINT32 DES_SBOX6[];
 
44
        static const UINT32 DES_SBOX7[];
 
45
        static const UINT32 DES_SBOX8[];
 
46
        static const UINT32 DES_MASK_TABLE[];
 
47
        static const UINT8 DES_ROTATE_TABLE[16];
 
48
 
 
49
        void find_file(const char *name, const UINT8 *dir_sector, UINT32 &file_start, UINT32 &file_size);
 
50
 
 
51
        inline void permutate(UINT32 &a, UINT32 &b, UINT32 m, int shift);
 
52
        void des_generate_subkeys(const UINT64 key, UINT32 *subkeys);
 
53
        UINT64 des_encrypt_decrypt(bool decrypt, UINT64 src, const UINT32 *des_subkeys);
 
54
        UINT64 rev64(UINT64 src);
 
55
        UINT64 read_to_qword(const UINT8 *region);
 
56
        void write_from_qword(UINT8 *region, UINT64 qword);
 
57
};
 
58
 
 
59
extern const device_type NAOMI_GDROM_BOARD;
 
60
 
 
61
#endif