2005-03-02 23:49:38 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Michiel van der Kolk, Jens Arnold
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-03-02 23:49:38 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2006-01-20 13:05:52 +00:00
|
|
|
#ifndef __ROCKMACROS_H__
|
|
|
|
#define __ROCKMACROS_H__
|
2005-03-02 23:49:38 +00:00
|
|
|
|
2005-06-24 22:33:21 +00:00
|
|
|
#include "plugin.h"
|
2005-03-02 23:49:38 +00:00
|
|
|
|
|
|
|
#define malloc(a) my_malloc(a)
|
|
|
|
void *my_malloc(size_t size);
|
|
|
|
|
|
|
|
extern int shut,cleanshut;
|
|
|
|
void vid_init(void);
|
2010-09-07 14:09:11 +00:00
|
|
|
void vid_begin(void);
|
2005-03-02 23:49:38 +00:00
|
|
|
void die(char *message, ...);
|
2006-01-20 13:05:52 +00:00
|
|
|
void doevents(void) ICODE_ATTR;
|
2005-03-02 23:49:38 +00:00
|
|
|
void ev_poll(void);
|
2005-03-03 19:54:47 +00:00
|
|
|
int do_user_menu(void);
|
2007-06-24 16:00:55 +00:00
|
|
|
void setvidmode(void);
|
2007-10-16 18:16:22 +00:00
|
|
|
#if defined(HAVE_LCD_COLOR)
|
2007-02-06 21:41:08 +00:00
|
|
|
void set_pal(void);
|
2007-10-16 18:16:22 +00:00
|
|
|
#else
|
2007-02-06 21:41:08 +00:00
|
|
|
void vid_update(int scanline);
|
|
|
|
#endif
|
|
|
|
#ifdef DYNAREC
|
|
|
|
extern struct dynarec_block newblock;
|
|
|
|
void dynamic_recompile (struct dynarec_block *newblock);
|
|
|
|
#endif
|
|
|
|
|
2005-03-03 19:54:47 +00:00
|
|
|
#define USER_MENU_QUIT -2
|
|
|
|
|
2007-02-06 21:41:08 +00:00
|
|
|
/* Disable IBSS when using dynarec since it won't fit */
|
|
|
|
#ifdef DYNAREC
|
|
|
|
#undef IBSS_ATTR
|
|
|
|
#define IBSS_ATTR
|
|
|
|
#endif
|
|
|
|
|
2005-03-03 19:54:47 +00:00
|
|
|
/* libc functions */
|
|
|
|
#define isdigit(c) ((c) >= '0' && (c) <= '9')
|
|
|
|
#define isalpha(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && ((c) <= 'Z')))
|
|
|
|
#define isalnum(c) (isdigit(c) || (isalpha(c)))
|
2005-03-02 23:49:38 +00:00
|
|
|
|
2010-05-06 17:35:13 +00:00
|
|
|
/* only 1 fixed argument for open, since variadic macros don't except empty
|
|
|
|
* variable parameters */
|
|
|
|
#define open(a, ...) rb->open((a), __VA_ARGS__)
|
2005-03-02 23:49:38 +00:00
|
|
|
#define lseek(a,b,c) rb->lseek((a),(b),(c))
|
2006-01-20 13:05:52 +00:00
|
|
|
#define close(a) rb->close((a))
|
2007-09-08 12:20:53 +00:00
|
|
|
#define read(a,b,c) rb->read((a),(b),(c))
|
|
|
|
#define write(a,b,c) rb->write((a),(b),(c))
|
2005-03-02 23:49:38 +00:00
|
|
|
#define strcat(a,b) rb->strcat((a),(b))
|
|
|
|
#define memset(a,b,c) rb->memset((a),(b),(c))
|
|
|
|
#define strcpy(a,b) rb->strcpy((a),(b))
|
2009-07-14 13:57:45 +00:00
|
|
|
#define strlcpy(a,b,c) rb->strlcpy((a),(b),(c))
|
2005-03-02 23:49:38 +00:00
|
|
|
#define strlen(a) rb->strlen((a))
|
|
|
|
#define strcmp(a,b) rb->strcmp((a),(b))
|
|
|
|
#define strchr(a,b) rb->strchr((a),(b))
|
|
|
|
#define strrchr(a,b) rb->strrchr((a),(b))
|
|
|
|
#define strcasecmp(a,b) rb->strcasecmp((a),(b))
|
|
|
|
#define srand(a) rb->srand((a))
|
|
|
|
#define rand() rb->rand()
|
|
|
|
#define atoi(a) rb->atoi((a))
|
|
|
|
#define strcat(a,b) rb->strcat((a),(b))
|
|
|
|
#define snprintf(...) rb->snprintf(__VA_ARGS__)
|
2005-03-03 19:44:02 +00:00
|
|
|
#define fdprintf(...) rb->fdprintf(__VA_ARGS__)
|
2005-03-02 23:49:38 +00:00
|
|
|
#define tolower(_A_) (isupper(_A_) ? (_A_ - 'A' + 'a') : _A_)
|
|
|
|
|
2005-09-28 17:36:42 +00:00
|
|
|
/* Using #define isn't enough with GCC 4.0.1 */
|
2007-02-06 21:41:08 +00:00
|
|
|
void* memcpy(void* dst, const void* src, size_t size) ICODE_ATTR;
|
2006-01-10 21:55:56 +00:00
|
|
|
|
2006-01-20 13:05:52 +00:00
|
|
|
struct options {
|
|
|
|
int A, B, START, SELECT, MENU;
|
2007-06-24 16:00:55 +00:00
|
|
|
int UP, DOWN, LEFT, RIGHT;
|
2006-01-20 13:05:52 +00:00
|
|
|
int frameskip, fps, maxskip;
|
2007-10-16 18:16:22 +00:00
|
|
|
int sound, scaling, showstats;
|
2010-11-25 12:45:13 +00:00
|
|
|
int autosave;
|
2007-06-24 16:00:55 +00:00
|
|
|
int rotate;
|
2007-02-06 21:41:08 +00:00
|
|
|
int pal;
|
2007-06-24 16:00:55 +00:00
|
|
|
int dirty;
|
2006-01-20 13:05:52 +00:00
|
|
|
};
|
|
|
|
|
2011-03-19 10:14:12 +00:00
|
|
|
extern bool plugbuf;
|
2007-04-18 07:41:31 +00:00
|
|
|
|
2006-01-20 13:05:52 +00:00
|
|
|
extern struct options options;
|
2007-09-10 09:46:36 +00:00
|
|
|
#define savedir ROCKBOX_DIR "/rockboy"
|
2006-01-20 13:05:52 +00:00
|
|
|
|
|
|
|
#endif
|