Fixed compilation on linux
This commit is contained in:
parent
0e4367f2a2
commit
86aa5d9800
|
@ -43,7 +43,9 @@ libdesmume_a_SOURCES = \
|
||||||
utils/ConvertUTF.c utils/ConvertUTF.h utils/guid.cpp utils/guid.h \
|
utils/ConvertUTF.c utils/ConvertUTF.h utils/guid.cpp utils/guid.h \
|
||||||
utils/md5.cpp utils/md5.h utils/valuearray.h utils/xstring.cpp utils/xstring.h \
|
utils/md5.cpp utils/md5.h utils/valuearray.h utils/xstring.cpp utils/xstring.h \
|
||||||
utils/decrypt/crc.cpp utils/decrypt/crc.h utils/decrypt/decrypt.cpp \
|
utils/decrypt/crc.cpp utils/decrypt/crc.h utils/decrypt/decrypt.cpp \
|
||||||
utils/decrypt/decrypt.h utils/decrypt/header.cpp utils/decrypt/header.h
|
utils/decrypt/decrypt.h utils/decrypt/header.cpp utils/decrypt/header.h \
|
||||||
|
addons.c addons.h \
|
||||||
|
addons/compactFlash.cpp addons/gbagame.cpp addons/none.cpp addons/rumblepak.cpp
|
||||||
if HAVE_GDB_STUB
|
if HAVE_GDB_STUB
|
||||||
libdesmume_a_SOURCES += gdbstub.h
|
libdesmume_a_SOURCES += gdbstub.h
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -1,32 +1,37 @@
|
||||||
/* Copyright (C) 2006 yopyop
|
/* Copyright (C) 2006 yopyop
|
||||||
yopyop156@ifrance.com
|
yopyop156@ifrance.com
|
||||||
yopyop156.ifrance.com
|
yopyop156.ifrance.com
|
||||||
|
|
||||||
Copyright (C) 2009 DeSmuME team
|
Copyright (C) 2009 DeSmuME team
|
||||||
|
|
||||||
This file is part of DeSmuME
|
This file is part of DeSmuME
|
||||||
|
|
||||||
DeSmuME is free software; you can redistribute it and/or modify
|
DeSmuME is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
DeSmuME is distributed in the hope that it will be useful,
|
DeSmuME is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with DeSmuME; if not, write to the Free Software
|
along with DeSmuME; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __ADDONS_H__
|
#ifndef __ADDONS_H__
|
||||||
#define __ADDONS_H__
|
#define __ADDONS_H__
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#include <limits.h>
|
||||||
|
#define MAX_PATH PATH_MAX
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -83,4 +88,4 @@ extern void addonsClose(); // Shutdown addons
|
||||||
extern void addonsReset(); // Reset addon
|
extern void addonsReset(); // Reset addon
|
||||||
extern BOOL addonsChangePak(u8 type); // change current adddon
|
extern BOOL addonsChangePak(u8 type); // change current adddon
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../addons.h"
|
#include "../addons.h"
|
||||||
|
#include <string.h>
|
||||||
#ifdef EXPERIMENTAL_GBASLOT
|
#ifdef EXPERIMENTAL_GBASLOT
|
||||||
|
|
||||||
#define DEBUG
|
#define DEBUG
|
||||||
|
@ -31,7 +32,6 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -1031,4 +1031,4 @@ ADDONINTERFACE addonCFlash = {
|
||||||
CFlash_info};
|
CFlash_info};
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
#undef CFLASHDEBUG
|
#undef CFLASHDEBUG
|
||||||
|
|
|
@ -23,82 +23,83 @@
|
||||||
|
|
||||||
#include "../addons.h"
|
#include "../addons.h"
|
||||||
#include "../mem.h"
|
#include "../mem.h"
|
||||||
|
#include <string.h>
|
||||||
#include "../MMU.h"
|
#include "../MMU.h"
|
||||||
|
|
||||||
u8 *GBArom = NULL;
|
u8 *GBArom = NULL;
|
||||||
|
|
||||||
BOOL GBAgame_init(void)
|
BOOL GBAgame_init(void)
|
||||||
{
|
{
|
||||||
GBArom = new u8 [32 * 1024 * 1024];
|
GBArom = new u8 [32 * 1024 * 1024];
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
};
|
};
|
||||||
void GBAgame_reset(void)
|
void GBAgame_reset(void)
|
||||||
{
|
{
|
||||||
memset(GBArom, 0, 32 * 1024 * 1024);
|
memset(GBArom, 0, 32 * 1024 * 1024);
|
||||||
|
|
||||||
if (!strlen(GBAgameName)) return;
|
if (!strlen(GBAgameName)) return;
|
||||||
FILE *fgame = 0;
|
FILE *fgame = 0;
|
||||||
|
|
||||||
fgame = fopen(GBAgameName,"rb");
|
fgame = fopen(GBAgameName,"rb");
|
||||||
if (!fgame) return;
|
if (!fgame) return;
|
||||||
INFO("Loaded \"%s\" in GBA slot\n", GBAgameName);
|
INFO("Loaded \"%s\" in GBA slot\n", GBAgameName);
|
||||||
fseek(fgame, 0, SEEK_END);
|
fseek(fgame, 0, SEEK_END);
|
||||||
u32 size = ftell(fgame);
|
u32 size = ftell(fgame);
|
||||||
rewind(fgame);
|
rewind(fgame);
|
||||||
|
|
||||||
if (!fread(GBArom, 1, size, fgame))
|
if (!fread(GBArom, 1, size, fgame))
|
||||||
{
|
{
|
||||||
fclose(fgame);
|
fclose(fgame);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fgame);
|
fclose(fgame);
|
||||||
};
|
};
|
||||||
void GBAgame_close(void)
|
void GBAgame_close(void)
|
||||||
{
|
{
|
||||||
if (GBArom)
|
if (GBArom)
|
||||||
{
|
{
|
||||||
delete [] GBArom;
|
delete [] GBArom;
|
||||||
GBArom = NULL;
|
GBArom = NULL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
void GBAgame_config(void) {}
|
void GBAgame_config(void) {}
|
||||||
void GBAgame_write08(u32 adr, u8 val){}
|
void GBAgame_write08(u32 adr, u8 val){}
|
||||||
void GBAgame_write16(u32 adr, u16 val) {}
|
void GBAgame_write16(u32 adr, u16 val) {}
|
||||||
void GBAgame_write32(u32 adr, u32 val) {}
|
void GBAgame_write32(u32 adr, u32 val) {}
|
||||||
u8 GBAgame_read08(u32 adr)
|
u8 GBAgame_read08(u32 adr)
|
||||||
{
|
{
|
||||||
//INFO("Read08 at 0x%08X value 0x%02X\n", adr, (u8)T1ReadByte(GBArom, (adr - 0x08000000)));
|
//INFO("Read08 at 0x%08X value 0x%02X\n", adr, (u8)T1ReadByte(GBArom, (adr - 0x08000000)));
|
||||||
if ( (adr >= 0x08000004) && (adr < 0x080000A0) )
|
if ( (adr >= 0x08000004) && (adr < 0x080000A0) )
|
||||||
return MMU.MMU_MEM[0][0xFF][(adr +0x1C) & MMU.MMU_MASK[0][0xFF]];
|
return MMU.MMU_MEM[0][0xFF][(adr +0x1C) & MMU.MMU_MASK[0][0xFF]];
|
||||||
return (u8)T1ReadByte(GBArom, (adr - 0x08000000));
|
return (u8)T1ReadByte(GBArom, (adr - 0x08000000));
|
||||||
}
|
}
|
||||||
u16 GBAgame_read16(u32 adr)
|
u16 GBAgame_read16(u32 adr)
|
||||||
{
|
{
|
||||||
//INFO("Read16 at 0x%08X value 0x%04X\n", adr, (u16)T1ReadWord(GBArom, (adr - 0x08000000)));
|
//INFO("Read16 at 0x%08X value 0x%04X\n", adr, (u16)T1ReadWord(GBArom, (adr - 0x08000000)));
|
||||||
if ( (adr >= 0x08000004) && (adr < 0x080000A0) )
|
if ( (adr >= 0x08000004) && (adr < 0x080000A0) )
|
||||||
return T1ReadWord(MMU.MMU_MEM[0][0xFF], (adr +0x1C) & MMU.MMU_MASK[0][0xFF]);
|
return T1ReadWord(MMU.MMU_MEM[0][0xFF], (adr +0x1C) & MMU.MMU_MASK[0][0xFF]);
|
||||||
return (u16)T1ReadWord(GBArom, (adr - 0x08000000));
|
return (u16)T1ReadWord(GBArom, (adr - 0x08000000));
|
||||||
}
|
}
|
||||||
u32 GBAgame_read32(u32 adr)
|
u32 GBAgame_read32(u32 adr)
|
||||||
{
|
{
|
||||||
//INFO("Read32 at 0x%08X value 0x%08X\n", adr, (u32)T1ReadLong(GBArom, (adr - 0x08000000)));
|
//INFO("Read32 at 0x%08X value 0x%08X\n", adr, (u32)T1ReadLong(GBArom, (adr - 0x08000000)));
|
||||||
if ( (adr >= 0x08000004) && (adr < 0x080000A0) )
|
if ( (adr >= 0x08000004) && (adr < 0x080000A0) )
|
||||||
return T1ReadLong(MMU.MMU_MEM[0][0xFF], (adr +0x1C) & MMU.MMU_MASK[0][0xFF]);
|
return T1ReadLong(MMU.MMU_MEM[0][0xFF], (adr +0x1C) & MMU.MMU_MASK[0][0xFF]);
|
||||||
return (u32)T1ReadLong(GBArom, (adr - 0x08000000));
|
return (u32)T1ReadLong(GBArom, (adr - 0x08000000));
|
||||||
}
|
}
|
||||||
void GBAgame_info(char *info) { strcpy(info, "GBA game in slot"); };
|
void GBAgame_info(char *info) { strcpy(info, "GBA game in slot"); };
|
||||||
|
|
||||||
ADDONINTERFACE addonGBAgame = {
|
ADDONINTERFACE addonGBAgame = {
|
||||||
"GBA game",
|
"GBA game",
|
||||||
GBAgame_init,
|
GBAgame_init,
|
||||||
GBAgame_reset,
|
GBAgame_reset,
|
||||||
GBAgame_close,
|
GBAgame_close,
|
||||||
GBAgame_config,
|
GBAgame_config,
|
||||||
GBAgame_write08,
|
GBAgame_write08,
|
||||||
GBAgame_write16,
|
GBAgame_write16,
|
||||||
GBAgame_write32,
|
GBAgame_write32,
|
||||||
GBAgame_read08,
|
GBAgame_read08,
|
||||||
GBAgame_read16,
|
GBAgame_read16,
|
||||||
GBAgame_read32,
|
GBAgame_read32,
|
||||||
GBAgame_info};
|
GBAgame_info};
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../addons.h"
|
#include "../addons.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
BOOL None_init(void) { return (TRUE); };
|
BOOL None_init(void) { return (TRUE); };
|
||||||
void None_reset(void) {};
|
void None_reset(void) {};
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "../addons.h"
|
#include "../addons.h"
|
||||||
#include "../mem.h"
|
#include "../mem.h"
|
||||||
#include "../MMU.h"
|
#include "../MMU.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
u8 rumble_hdr[0xC0];
|
u8 rumble_hdr[0xC0];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue