filename | src/lxdream.h |
changeset | 909:b4a21af8ce8c |
prev | 905:4c17ebd9ef5e |
next | 939:6f2302afeb89 |
author | nkeynes |
date | Sat Dec 27 02:59:35 2008 +0000 (15 years ago) |
branch | lxdream-mem |
permissions | -rw-r--r-- |
last change | Replace fpscr_mask/fpscr flags in xlat_cache_block with a single xlat_sh4_mode, which tracks the field of the same name in sh4r - actually a little faster this way. Now depends on SR.MD, FPSCR.PR and FPSCR.SZ (although it doesn't benefit from the SR flag yet). Also fixed the failure to check the flags in the common case (code address returned by previous block) which took away the performance benefits, but oh well. |
view | annotate | diff | log | raw |
1 /**
2 * $Id$
3 *
4 * Common type definitions and forward declarations
5 *
6 * Copyright (c) 2005 Nathan Keynes.
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 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
19 #ifndef lxdream_lxdream_H
20 #define lxdream_lxdream_H 1
22 #include <stdint.h>
23 #include <glib/gtypes.h>
25 #include "../config.h"
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
31 #define APP_NAME PACKAGE
32 extern const char lxdream_package_name[];
33 extern const char lxdream_short_version[];
34 extern const char lxdream_full_version[];
35 extern const char lxdream_copyright[];
38 #define MB *1024*1024
39 #define KB *1024
41 #ifndef max
42 #define max(a,b) ( (a) > (b) ? (a) : (b) )
43 #endif
45 /**
46 * A 29-bit address in SH4 external address space
47 */
48 typedef uint32_t sh4addr_t;
50 /**
51 * A 32-bit address in SH4 virtual address space.
52 */
53 typedef uint32_t sh4vma_t;
55 /**
56 * A direct pointer into SH4 memory
57 */
58 typedef unsigned char *sh4ptr_t;
60 /******************* Forward type declarations ******************/
62 typedef struct render_buffer *render_buffer_t;
63 typedef struct frame_buffer *frame_buffer_t;
65 /*************************** Logging ****************************/
67 #define EMIT_FATAL 0
68 #define EMIT_ERR 1
69 #define EMIT_WARN 2
70 #define EMIT_INFO 3
71 #define EMIT_DEBUG 4
72 #define EMIT_TRACE 5
74 #ifdef MODULE
75 #define MODULE_NAME MODULE.name
76 #else
77 #define MODULE_NAME "*****"
78 #endif
80 gboolean set_global_log_level( const gchar *level );
81 void log_message( void *, int level, const char *source, const char *msg, ... );
83 #define FATAL( ... ) log_message( NULL, EMIT_FATAL, MODULE_NAME, __VA_ARGS__ )
84 #define ERROR( ... ) log_message( NULL, EMIT_ERR, MODULE_NAME, __VA_ARGS__ )
85 #define WARN( ... ) log_message( NULL, EMIT_WARN, MODULE_NAME, __VA_ARGS__ )
86 #define INFO( ... ) log_message( NULL, EMIT_INFO, MODULE_NAME, __VA_ARGS__ )
87 #define DEBUG( ... ) log_message( NULL, EMIT_DEBUG, MODULE_NAME, __VA_ARGS__ )
88 #define TRACE( ... ) log_message( NULL, EMIT_TRACE, MODULE_NAME, __VA_ARGS__ )
90 /****************** System paths ****************/
91 const char *get_sysconf_path();
92 const char *get_locale_path();
94 #ifdef HAVE_FASTCALL
95 #define FASTCALL __attribute__((regparm(3)))
96 #else
97 #define FASTCALL
98 #endif
100 #ifdef __cplusplus
101 }
102 #endif
104 #endif /* !lxdream_lxdream_H */
.