2005-03-02 23:49:38 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Michiel van der Kolk, Jens Arnold
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
2005-05-07 22:41:17 +00:00
|
|
|
#include "autoconf.h"
|
2005-03-02 23:49:38 +00:00
|
|
|
|
|
|
|
#define malloc(a) my_malloc(a)
|
|
|
|
void *my_malloc(size_t size);
|
|
|
|
|
|
|
|
extern struct plugin_api* rb;
|
|
|
|
extern int shut,cleanshut;
|
|
|
|
void vid_update(int scanline);
|
|
|
|
void vid_init(void);
|
2006-01-20 13:05:52 +00:00
|
|
|
inline void vid_begin(void);
|
2005-03-02 23:49:38 +00:00
|
|
|
void vid_end(void);
|
|
|
|
void die(char *message, ...);
|
|
|
|
void setmallocpos(void *pointer);
|
|
|
|
void vid_settitle(char *title);
|
|
|
|
void *sys_timer(void);
|
|
|
|
int sys_elapsed(long *oldtick);
|
|
|
|
void sys_sleep(int us);
|
|
|
|
int pcm_submit(void);
|
|
|
|
void pcm_init(void);
|
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);
|
2005-03-04 09:30:27 +00:00
|
|
|
void loadstate(int fd);
|
|
|
|
void savestate(int fd);
|
2006-06-19 02:44:50 +00:00
|
|
|
void setvidmode(int mode);
|
2005-03-03 19:54:47 +00:00
|
|
|
#define USER_MENU_QUIT -2
|
|
|
|
|
2006-01-20 20:59:07 +00:00
|
|
|
/* Disable ICODE for the ARMs */
|
|
|
|
#ifdef CPU_ARM
|
|
|
|
#undef ICODE_ATTR
|
|
|
|
#define ICODE_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
|
|
|
|
|
|
|
#ifdef SIMULATOR
|
|
|
|
#undef opendir
|
|
|
|
#define opendir(a) rb->sim_opendir((a))
|
|
|
|
#undef closedir
|
|
|
|
#define closedir(a) rb->sim_closedir((a))
|
|
|
|
#undef mkdir
|
|
|
|
#define mkdir(a,b) rb->sim_mkdir((a),(b))
|
|
|
|
#undef open
|
|
|
|
#define open(a,b) rb->sim_open((a),(b))
|
2006-01-20 13:05:52 +00:00
|
|
|
#undef close
|
2006-01-20 13:59:40 +00:00
|
|
|
#define close(a) rb->close((a))
|
2005-03-02 23:49:38 +00:00
|
|
|
#undef lseek
|
|
|
|
#define lseek(a,b,c) rb->sim_lseek((a),(b),(c))
|
|
|
|
#else /* !SIMULATOR */
|
|
|
|
#define opendir(a) rb->opendir((a))
|
|
|
|
#define closedir(a) rb->closedir((a))
|
|
|
|
#define mkdir(a,b) rb->mkdir((a),(b))
|
|
|
|
#define open(a,b) rb->open((a),(b))
|
|
|
|
#define lseek(a,b,c) rb->lseek((a),(b),(c))
|
2006-01-20 13:05:52 +00:00
|
|
|
#define close(a) rb->close((a))
|
2005-03-02 23:49:38 +00:00
|
|
|
#endif /* !SIMULATOR */
|
|
|
|
|
|
|
|
#define strcat(a,b) rb->strcat((a),(b))
|
|
|
|
#define read(a,b,c) rb->read((a),(b),(c))
|
|
|
|
#define write(a,b,c) rb->write((a),(b),(c))
|
|
|
|
#define memset(a,b,c) rb->memset((a),(b),(c))
|
|
|
|
#define strcpy(a,b) rb->strcpy((a),(b))
|
|
|
|
#define strncpy(a,b,c) rb->strncpy((a),(b),(c))
|
|
|
|
#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 */
|
|
|
|
void* memcpy(void* dst, const void* src, size_t size);
|
2006-01-10 21:55:56 +00:00
|
|
|
|
2006-01-20 13:05:52 +00:00
|
|
|
struct options {
|
|
|
|
int A, B, START, SELECT, MENU;
|
|
|
|
int frameskip, fps, maxskip;
|
2006-06-19 01:47:45 +00:00
|
|
|
int sound, fullscreen, showstats;
|
2006-01-20 13:05:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct options options;
|
|
|
|
#define savedir "/.rockbox/rockboy"
|
|
|
|
|
|
|
|
#endif
|