~registry/dolphin-emu/triforce

« back to all changes in this revision

Viewing changes to Source/Core/Core/Src/GeckoCode.h

  • Committer: Sérgio Benjamim
  • Date: 2015-02-13 05:54:40 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20150213055440-ey2rt3sjpy27km78
Dolphin Triforce branch from code.google, commit b957980 (4.0-315).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2013 Dolphin Emulator Project
 
2
// Licensed under GPLv2
 
3
// Refer to the license.txt file included.
 
4
 
 
5
#ifndef __GECKOCODE_h__
 
6
#define __GECKOCODE_h__
 
7
 
 
8
#include "Common.h"
 
9
 
 
10
#include <vector>
 
11
#include <string>
 
12
#include <map>
 
13
 
 
14
namespace Gecko
 
15
{
 
16
 
 
17
        class GeckoCode
 
18
        {
 
19
        public:
 
20
 
 
21
                GeckoCode() : enabled(false) {}
 
22
 
 
23
                struct Code
 
24
                {
 
25
                        Code() : address(0), data(0) {}
 
26
 
 
27
                        union
 
28
                        {
 
29
                                u32     address;
 
30
 
 
31
                                struct
 
32
                                {
 
33
                                        u32 gcaddress : 25;
 
34
                                        u32 subtype: 3;
 
35
                                        u32 use_po : 1;
 
36
                                        u32 type: 3;
 
37
                                };
 
38
 
 
39
                                struct
 
40
                                {
 
41
                                        u32 n : 4;
 
42
                                        u32 z : 12;
 
43
                                        u32 y : 4;
 
44
                                        u32 t : 4;
 
45
                                        //u32 s : 4;
 
46
                                        //u32 : 4;
 
47
                                };// subsubtype;
 
48
                        };
 
49
 
 
50
                        union
 
51
                        {
 
52
                                u32 data;
 
53
                                //struct
 
54
                                //{
 
55
                                //      
 
56
                                //};
 
57
                        };
 
58
 
 
59
                        std::string original_line;
 
60
 
 
61
                        u32 GetAddress() const;
 
62
                };
 
63
 
 
64
                std::vector<Code>       codes;
 
65
                std::string             name, creator;
 
66
                std::vector<std::string>        notes;
 
67
 
 
68
                bool enabled;
 
69
                bool user_defined;
 
70
 
 
71
                bool Compare(GeckoCode compare) const;
 
72
                bool Exist(u32 address, u32 data);
 
73
        };
 
74
 
 
75
        void SetActiveCodes(const std::vector<GeckoCode>& gcodes);
 
76
        bool RunActiveCodes();
 
77
        void RunCodeHandler();
 
78
        const std::map<u32, std::vector<u32> >& GetInsertedAsmCodes();
 
79
 
 
80
}       // namespace Gecko
 
81
 
 
82
#endif