Search
lxdream.org :: lxdream/src/lxdream.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/lxdream.h
changeset 569:a1c49e1e8776
prev561:533f6b478071
next1065:bc1cc0c54917
author nkeynes
date Fri Jan 04 11:54:17 2008 +0000 (13 years ago)
branchlxdream-mmu
permissions -rw-r--r--
last change Bring icache partially into line with the mmu, a little less slow with AT off
now.
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_common_H
    20 #define lxdream_common_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 "lxDream"
    32 #define APP_VERSION "0.8.1"
    34 #define MB *1024*1024
    35 #define KB *1024
    37 #ifndef max
    38 #define max(a,b) ( (a) > (b) ? (a) : (b) )
    39 #endif
    41 /**
    42  * A 29-bit address in SH4 external address space
    43  */
    44 typedef uint32_t sh4addr_t;
    46 /**
    47  * A 32-bit address in SH4 virtual address space.
    48  */
    49 typedef uint32_t sh4vma_t;
    51 /**
    52  * A direct pointer into SH4 memory
    53  */
    54 typedef unsigned char *sh4ptr_t;
    56 /******************* Forward type declarations ******************/
    58 typedef struct render_buffer *render_buffer_t;
    59 typedef struct frame_buffer *frame_buffer_t;
    61 /*************************** Logging ****************************/
    63 #define EMIT_FATAL 0
    64 #define EMIT_ERR 1
    65 #define EMIT_WARN 2
    66 #define EMIT_INFO 3
    67 #define EMIT_DEBUG 4
    68 #define EMIT_TRACE 5
    70 #ifdef MODULE
    71 #define MODULE_NAME MODULE.name
    72 #else
    73 #define MODULE_NAME "*****"
    74 #endif
    76 gboolean set_global_log_level( const gchar *level );
    77 void log_message( void *, int level, const char *source, const char *msg, ... );
    79 #define FATAL( ... ) log_message( NULL, EMIT_FATAL, MODULE_NAME, __VA_ARGS__ )
    80 #define ERROR( ... ) log_message( NULL, EMIT_ERR, MODULE_NAME, __VA_ARGS__ )
    81 #define WARN( ... ) log_message( NULL, EMIT_WARN, MODULE_NAME, __VA_ARGS__ )
    82 #define INFO( ... ) log_message( NULL, EMIT_INFO, MODULE_NAME, __VA_ARGS__ )
    83 #define DEBUG( ... ) log_message( NULL, EMIT_DEBUG, MODULE_NAME, __VA_ARGS__ )
    84 #define TRACE( ... ) log_message( NULL, EMIT_TRACE, MODULE_NAME, __VA_ARGS__ )
    88 #ifdef __cplusplus
    89 }
    90 #endif
    92 #endif /* !lxdream_common_H */
.