Search
lxdream.org :: lxdream/src/lxdream.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/lxdream.h
changeset 502:c4ecae2b1b5e
prev477:9a373f2ff009
next503:36a668469e37
author nkeynes
date Thu Nov 08 11:54:16 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Add sh4ptr_t type, start converting bare pointer refs to it
file annotate diff log raw
nkeynes@477
     1
/**
nkeynes@502
     2
 * $Id: lxdream.h,v 1.2 2007-11-08 11:54:16 nkeynes Exp $
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@477
    19
#ifndef lxdream_common_H
nkeynes@477
    20
#define lxdream_common_H 1
nkeynes@477
    21
nkeynes@477
    22
#include <stdint.h>
nkeynes@477
    23
#include <glib/gtypes.h>
nkeynes@477
    24
nkeynes@477
    25
#ifdef __cplusplus
nkeynes@477
    26
extern "C" {
nkeynes@477
    27
#endif
nkeynes@477
    28
nkeynes@477
    29
#define APP_NAME "lxDream"
nkeynes@477
    30
#define APP_VERSION "0.8"
nkeynes@477
    31
nkeynes@477
    32
#define MB *1024*1024
nkeynes@477
    33
#define KB *1024
nkeynes@477
    34
nkeynes@477
    35
#ifndef max
nkeynes@477
    36
#define max(a,b) ( (a) > (b) ? (a) : (b) )
nkeynes@477
    37
#endif
nkeynes@477
    38
nkeynes@502
    39
/**
nkeynes@502
    40
 * A 32-bit address in SH4 space
nkeynes@502
    41
 */
nkeynes@477
    42
typedef uint32_t sh4addr_t;
nkeynes@502
    43
/**
nkeynes@502
    44
 * A direct pointer into SH4 memory
nkeynes@502
    45
 */
nkeynes@502
    46
typedef unsigned char *sh4ptr_t;
nkeynes@477
    47
nkeynes@477
    48
/******************* Forward type declarations ******************/
nkeynes@477
    49
nkeynes@477
    50
typedef struct render_buffer *render_buffer_t;
nkeynes@477
    51
typedef struct frame_buffer *frame_buffer_t;
nkeynes@477
    52
nkeynes@477
    53
/*************************** Logging ****************************/
nkeynes@477
    54
nkeynes@477
    55
#define EMIT_FATAL 0
nkeynes@477
    56
#define EMIT_ERR 1
nkeynes@477
    57
#define EMIT_WARN 2
nkeynes@477
    58
#define EMIT_INFO 3
nkeynes@477
    59
#define EMIT_DEBUG 4
nkeynes@477
    60
#define EMIT_TRACE 5
nkeynes@477
    61
nkeynes@477
    62
#ifdef MODULE
nkeynes@477
    63
#define MODULE_NAME MODULE.name
nkeynes@477
    64
#else
nkeynes@477
    65
#define MODULE_NAME "*****"
nkeynes@477
    66
#endif
nkeynes@477
    67
nkeynes@477
    68
void log_message( void *, int level, const char *source, const char *msg, ... );
nkeynes@477
    69
nkeynes@477
    70
#define FATAL( ... ) log_message( NULL, EMIT_FATAL, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    71
#define ERROR( ... ) log_message( NULL, EMIT_ERR, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    72
#define WARN( ... ) log_message( NULL, EMIT_WARN, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    73
#define INFO( ... ) log_message( NULL, EMIT_INFO, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    74
#define DEBUG( ... ) log_message( NULL, EMIT_DEBUG, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    75
#define TRACE( ... ) log_message( NULL, EMIT_TRACE, MODULE_NAME, __VA_ARGS__ )
nkeynes@477
    76
nkeynes@477
    77
nkeynes@477
    78
nkeynes@477
    79
#ifdef __cplusplus
nkeynes@477
    80
}
nkeynes@477
    81
#endif
nkeynes@477
    82
nkeynes@477
    83
#endif /* !lxdream_common_H */
.