~akheon23/pose/origin

« back to all changes in this revision

Viewing changes to SrcShared/Patches/EmPatchIf.h

  • Committer: Christopher Werkshage
  • Date: 2014-12-27 12:51:57 UTC
  • Revision ID: git-v1:cc9410eb6ec5b4e23248dc175d142202f86be8e8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++; tab-width: 4 -*- */
 
2
/* ===================================================================== *\
 
3
        Copyright (c) 2001 PocketPyro, Inc.
 
4
        All rights reserved.
 
5
 
 
6
        This file is part of the Palm OS Emulator.
 
7
 
 
8
        This program is free software; you can redistribute it and/or modify
 
9
        it under the terms of the GNU General Public License as published by
 
10
        the Free Software Foundation; either version 2 of the License, or
 
11
        (at your option) any later version.
 
12
\* ===================================================================== */
 
13
 
 
14
 
 
15
#ifndef EmPatchIf_h
 
16
#define EmPatchIf_h
 
17
 
 
18
#include "EcmIf.h"
 
19
 
 
20
 
 
21
enum
 
22
{
 
23
        kPatchErrNone,
 
24
        kPatchErrNotImplemented,
 
25
        kPatchErrInvalidIndex
 
26
};
 
27
 
 
28
 
 
29
enum CallROMType
 
30
{
 
31
        kExecuteROM,
 
32
        kSkipROM
 
33
};
 
34
 
 
35
 
 
36
// Function types for head- and Tailpatch functions.
 
37
 
 
38
typedef CallROMType     (*HeadpatchProc)(void);
 
39
typedef void            (*TailpatchProc)(void);
 
40
 
 
41
 
 
42
// ==============================================================================
 
43
// *  BEGIN IEmPatchLoader
 
44
// ==============================================================================
 
45
 
 
46
const EcmIfName kEmPatchLoaderIfn = "loader.patchmodule.i.ecm";
 
47
 
 
48
ecm_interface IEmPatchLoader : ecm_extends IEcmComponent
 
49
{
 
50
        virtual Err InitializePL        (void) = 0;
 
51
        virtual Err ResetPL                     (void) = 0;
 
52
        virtual Err DisposePL           (void) = 0;
 
53
        
 
54
        virtual Err ClearPL                     (void) = 0;
 
55
        virtual Err LoadPL                      (void) = 0;
 
56
 
 
57
        virtual Err LoadAllModules      (void) = 0;
 
58
        virtual Err LoadModule          (const string& url) = 0;
 
59
};
 
60
 
 
61
// ==============================================================================
 
62
// *  END IEmPatchLoader
 
63
// ==============================================================================
 
64
        
 
65
 
 
66
 
 
67
// ==============================================================================
 
68
// *  BEGIN IEmPatchContainer
 
69
// ==============================================================================
 
70
 
 
71
const EcmIfName kEmPatchContainerIfn = "container.patchmodule.i.ecm";
 
72
 
 
73
ecm_interface IEmPatchContainer : ecm_extends IEcmContainer
 
74
{
 
75
};
 
76
 
 
77
 
 
78
// ==============================================================================
 
79
// *  END IEmPatchContainer
 
80
// ==============================================================================
 
81
 
 
82
 
 
83
 
 
84
// ==============================================================================
 
85
// *  BEGIN IEmPatchDllTempHacks
 
86
// ==============================================================================
 
87
 
 
88
const EcmIfName kEmPatchDllTempHacksIfn = "hacks.dll.patchmodule.i.ecm";
 
89
 
 
90
ecm_interface IEmPatchDllTempHacks : ecm_extends IEcmComponent
 
91
{
 
92
        virtual Err GetGlobalMemBanks(void** membanksPP)=0;
 
93
        virtual Err GetGlobalRegs(void** regsPP)=0;
 
94
};
 
95
 
 
96
// ==============================================================================
 
97
// *  END IEmPatchDllTempHacks
 
98
// ==============================================================================
 
99
 
 
100
 
 
101
 
 
102
 
 
103
// ===========================================================================
 
104
//              IEmPatchModule interface exposed by all patch modules.
 
105
//                      this is how all patch modules appear to the patching sub-system
 
106
// ===========================================================================
 
107
 
 
108
const EcmIfName kEmPatchModuleIfn = "patchmodule.i.ecm";
 
109
 
 
110
ecm_interface IEmPatchModule : ecm_extends IEcmComponent
 
111
{
 
112
        virtual Err Initialize(IEmPatchContainer &containerIP) = 0;
 
113
        virtual Err Reset() = 0;
 
114
        virtual Err Dispose() = 0;
 
115
        
 
116
        virtual Err Clear () = 0;
 
117
        virtual Err Load () = 0;
 
118
 
 
119
        virtual const string &GetName() = 0;
 
120
 
 
121
        virtual Err GetHeadpatch (uint16 index, HeadpatchProc &procP) = 0;
 
122
        virtual Err GetTailpatch (uint16 index, TailpatchProc &procP) = 0;
 
123
};
 
124
 
 
125
 
 
126
 
 
127
 
 
128
// ===========================================================================
 
129
//              IEmPatchModuleMap interface supporting a collection of PatchModules
 
130
//                      Basically there is one component which maintains the list of all 
 
131
//                      installed patch modules, and it is accessed using IEmPatchModuleMap
 
132
// ===========================================================================
 
133
 
 
134
const EcmIfName kEmPatchModuleMapIfn = "map.patchmodule.i.ecm";
 
135
 
 
136
ecm_interface IEmPatchModuleMap : ecm_extends IEcmComponent
 
137
{
 
138
        virtual Err InitializeAll(IEmPatchContainer &containerI) = 0;
 
139
        virtual Err ResetAll() = 0;
 
140
        virtual Err DisposeAll() = 0;
 
141
        
 
142
        virtual Err ClearAll () = 0;
 
143
        virtual Err LoadAll () = 0;
 
144
 
 
145
        virtual Err AddModule (IEmPatchModule *moduleIP) = 0;
 
146
        
 
147
        virtual Err GetModuleByName (const string &nameStr, IEmPatchModule *& moduleIP) = 0;
 
148
};
 
149
 
 
150
#endif // EmPatchIf_h