Search
lxdream.org :: lxdream/src/lxdream.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/lxdream.h
changeset 905:4c17ebd9ef5e
prev866:86cd01c2b2d3
next909:b4a21af8ce8c
author nkeynes
date Wed Oct 29 23:51:58 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Use regparam calling conventions for all functions called from translated code,
along with a few other high-use functions. Can probably extend this to all functions,
but as it is this is a nice performance boost
file annotate diff log raw
nkeynes@477
     1
/**
nkeynes@586
     2
 * $Id$
nkeynes@477
     3
 *
nkeynes@477
     4
 * Common type definitions and forward declarations
nkeynes@477
     5
 *
nkeynes@477
     6
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@477
     7
 *
nkeynes@477
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@477
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@477
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@477
    11
 * (at your option) any later version.
nkeynes@477
    12
 *
nkeynes@477
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@477
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@477
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@477
    16
 * GNU General Public License for more details.
nkeynes@477
    17
 */
nkeynes@477
    18
nkeynes@736
    19
#ifndef lxdream_lxdream_H
nkeynes@736
    20
#define lxdream_lxdream_H 1
nkeynes@477
    21
nkeynes@477
    22
#include <stdint.h>
nkeynes@477
    23
#include <glib/gtypes.h>
nkeynes@477
    24
nkeynes@507
    25
#include "../config.h"
nkeynes@507
    26
nkeynes@477
    27
#ifdef __cplusplus
nkeynes@477
    28
extern "C" {
nkeynes@477
    29
#endif
nkeynes@477
    30
nkeynes@738
    31
#define APP_NAME PACKAGE
nkeynes@738
    32
extern const char lxdream_package_name[];
nkeynes@738
    33
extern const char lxdream_short_version[];
nkeynes@738
    34
extern const char lxdream_full_version[];
nkeynes@738
    35
extern const char lxdream_copyright[];
nkeynes@738
    36
nkeynes@477
    37
nkeynes@477
    38
#define MB *1024*1024
nkeynes@477
    39
#define KB *1024
nkeynes@477
    40
nkeynes@477
    41
#ifndef max
nkeynes@477
    42
#define max(a,b) ( (a) > (b) ? (a) : (b) )
nkeynes@477
    43
#endif
nkeynes@477
    44
nkeynes@502
    45
/**
nkeynes@586
    46
 * A 29-bit address in SH4 external address space
nkeynes@502
    47
 */
nkeynes@477
    48
typedef uint32_t sh4addr_t;
nkeynes@586
    49
nkeynes@586
    50
/**
nkeynes@586
    51
 * A 32-bit address in SH4 virtual address space.
nkeynes@586
    52
 */
nkeynes@586
    53
typedef uint32_t sh4vma_t;
nkeynes@586
    54
nkeynes@502
    55
/**
nkeynes@502
    56
 * A direct pointer into SH4 memory
nkeynes@502
    57
 */
nkeynes@502
    58
typedef unsigned char *sh4ptr_t;
nkeynes@477
    59
nkeynes@477
    60
/******************* Forward type declarations ******************/
nkeynes@477
    61
nkeynes@477
    62
typedef struct render_buffer *render_buffer_t;
nkeynes@477
    63
typedef struct frame_buffer *frame_buffer_t;
nkeynes@477
    64
nkeynes@477
    65
/*************************** Logging ****************************/
nkeynes@477
    66
nkeynes@477
    67
#define EMIT_FATAL 0
nkeynes@477
    68
#define EMIT_ERR 1
nkeynes@477
    69
#define EMIT_WARN 2
nkeynes@477
    70
#define EMIT_INFO 3
nkeynes@477
    71
#define EMIT_DEBUG 4
nkeynes@477
    72
#define EMIT_TRACE 5
nkeynes@477
    73
nkeynes@477
    74
#ifdef MODULE
nkeynes@477
    75
#define MODULE_NAME MODULE.name
nkeynes@477
    76
#else
nkeynes@477
    77
#define MODULE_NAME "*****"
nkeynes@477
    78
#endif
nkeynes@477
    79
nkeynes@586
    80
gboolean set_global_log_level( const gchar *level );
nkeynes@477
    81
void log_message( void *, int level, const char *source, const char *msg, ... );
nkeynes@477
    82
nkeynes@477
    83
#define FATAL( ... ) log_message( NULL, EMIT_FATAL, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    84
#define ERROR( ... ) log_message( NULL, EMIT_ERR, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    85
#define WARN( ... ) log_message( NULL, EMIT_WARN, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    86
#define INFO( ... ) log_message( NULL, EMIT_INFO, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    87
#define DEBUG( ... ) log_message( NULL, EMIT_DEBUG, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    88
#define TRACE( ... ) log_message( NULL, EMIT_TRACE, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    89
nkeynes@866
    90
/****************** System paths ****************/
nkeynes@866
    91
const char *get_sysconf_path();
nkeynes@866
    92
const char *get_locale_path();
nkeynes@477
    93
nkeynes@905
    94
/* Use fast (regparam) calling conventions for core code - for now just turn it
nkeynes@905
    95
 * on always, but define the macro in case we need to remove it for some platforms
nkeynes@905
    96
 */
nkeynes@905
    97
#define HAVE_FASTCALL 1
nkeynes@905
    98
nkeynes@905
    99
#ifdef HAVE_FASTCALL
nkeynes@905
   100
#define FASTCALL __attribute__((regparm(3)))
nkeynes@905
   101
#else
nkeynes@905
   102
#define FASTCALL
nkeynes@905
   103
#endif
nkeynes@905
   104
nkeynes@477
   105
#ifdef __cplusplus
nkeynes@477
   106
}
nkeynes@477
   107
#endif
nkeynes@477
   108
nkeynes@736
   109
#endif /* !lxdream_lxdream_H */
.