RSP HLE plugin. Compile and run on the OpenPandora
[mupen64plus-pandora.git] / source / mupen64plus-rsp-hle / src / hle.h
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  *   Mupen64plus-rsp-hle - hle.h                                           *
3  *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
4  *   Copyright (C) 2002 Hacktarux                                          *
5  *                                                                         *
6  *   This program is free software; you can redistribute it and/or modify  *
7  *   it under the terms of the GNU General Public License as published by  *
8  *   the Free Software Foundation; either version 2 of the License, or     *
9  *   (at your option) any later version.                                   *
10  *                                                                         *
11  *   This program is distributed in the hope that it will be useful,       *
12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14  *   GNU General Public License for more details.                          *
15  *                                                                         *
16  *   You should have received a copy of the GNU General Public License     *
17  *   along with this program; if not, write to the                         *
18  *   Free Software Foundation, Inc.,                                       *
19  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
20  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
21
22 #ifndef HLE_H
23 #define HLE_H
24
25 #define M64P_PLUGIN_PROTOTYPES 1
26 #include "m64p_plugin.h"
27
28 #define RSP_HLE_VERSION        0x020000
29 #define RSP_PLUGIN_API_VERSION 0x020000
30
31 #ifdef M64P_BIG_ENDIAN
32 #define S 0
33 #define S16 0
34 #define S8 0
35 #else
36 #define S 1
37 #define S16 2
38 #define S8 3
39 #endif
40
41 // types
42 typedef unsigned char       u8;
43 typedef unsigned short      u16;
44 typedef unsigned int        u32;
45 typedef unsigned long long  u64;
46
47 typedef signed char         s8;
48 typedef signed short        s16;
49 typedef signed int          s32;
50 typedef signed long long    s64;
51
52 extern RSP_INFO rsp;
53
54 typedef struct
55 {
56     unsigned int type;
57     unsigned int flags;
58
59     unsigned int ucode_boot;
60     unsigned int ucode_boot_size;
61
62     unsigned int ucode;
63     unsigned int ucode_size;
64
65     unsigned int ucode_data;
66     unsigned int ucode_data_size;
67
68     unsigned int dram_stack;
69     unsigned int dram_stack_size;
70
71     unsigned int output_buff;
72     unsigned int output_buff_size;
73
74     unsigned int data_ptr;
75     unsigned int data_size;
76
77     unsigned int yield_data_ptr;
78     unsigned int yield_data_size;
79 } OSTask_t;
80
81 static inline const OSTask_t * const get_task()
82 {
83     return (OSTask_t*)(rsp.DMEM + 0xfc0);
84 }
85
86 void DebugMessage(int level, const char *message, ...);
87
88 #endif
89