Core:
- Do a massive cleanup of the #include and header structure. - Remove a lot of unnecessary dependencies in the headers. - Make headers responsible for including what they need for themselves. This makes the headers more independent of where they are in the #include order. - Relocate some structs/classes to more logical locations. - Clean up some platform-specific #ifdef stuff.
This commit is contained in:
parent
d5ab656090
commit
8fefb4fb7a
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2006 yopyop
|
Copyright 2006 yopyop
|
||||||
Copyright 2007 shash
|
Copyright 2007 shash
|
||||||
Copyright 2007-2012 DeSmuME team
|
Copyright 2007-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FIFO.h"
|
#include "FIFO.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "armcpu.h"
|
#include "armcpu.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
|
#include "registers.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "gfx3d.h"
|
#include "gfx3d.h"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2007 Theo Berkau
|
Copyright (C) 2006-2007 Theo Berkau
|
||||||
Copyright (C) 2007 shash
|
Copyright (C) 2007 shash
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,21 +18,26 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <iostream>
|
|
||||||
#include "MMU.h"
|
|
||||||
#include "GPU.h"
|
#include "GPU.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "MMU.h"
|
||||||
|
#include "FIFO.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "render3D.h"
|
#include "render3D.h"
|
||||||
|
#include "registers.h"
|
||||||
#include "gfx3d.h"
|
#include "gfx3d.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "GPU_osd.h"
|
#include "GPU_osd.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "readwrite.h"
|
#include "readwrite.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "emufile.h"
|
||||||
|
|
||||||
#ifdef FASTBUILD
|
#ifdef FASTBUILD
|
||||||
#undef FORCEINLINE
|
#undef FORCEINLINE
|
||||||
|
@ -2739,6 +2744,16 @@ template<bool MOSAIC> void GPU::modeRender(int layer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 GPU::getHOFS(int bg)
|
||||||
|
{
|
||||||
|
return T1ReadWord(&dispx_st->dispx_BGxOFS[bg].BGxHOFS,0) & 0x1FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 GPU::getVOFS(int bg)
|
||||||
|
{
|
||||||
|
return T1ReadWord(&dispx_st->dispx_BGxOFS[bg].BGxVOFS,0) & 0x1FF;
|
||||||
|
}
|
||||||
|
|
||||||
void gpu_SetRotateScreen(u16 angle)
|
void gpu_SetRotateScreen(u16 angle)
|
||||||
{
|
{
|
||||||
gpu_angle = angle;
|
gpu_angle = angle;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2007 Theo Berkau
|
Copyright (C) 2006-2007 Theo Berkau
|
||||||
Copyright (C) 2007 shash
|
Copyright (C) 2007 shash
|
||||||
Copyright (C) 2009-2012 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,13 +22,13 @@
|
||||||
#define GPU_H
|
#define GPU_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mem.h"
|
|
||||||
#include "common.h"
|
|
||||||
#include "registers.h"
|
|
||||||
#include "FIFO.h"
|
|
||||||
#include "MMU.h"
|
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
struct MMU_struct;
|
||||||
|
|
||||||
//#undef FORCEINLINE
|
//#undef FORCEINLINE
|
||||||
//#define FORCEINLINE
|
//#define FORCEINLINE
|
||||||
|
|
||||||
|
@ -783,8 +783,8 @@ struct GPU
|
||||||
updateBLDALPHA();
|
updateBLDALPHA();
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 getHOFS(int bg) { return T1ReadWord(&dispx_st->dispx_BGxOFS[bg].BGxHOFS,0) & 0x1FF; }
|
u32 getHOFS(int bg);
|
||||||
u32 getVOFS(int bg) { return T1ReadWord(&dispx_st->dispx_BGxOFS[bg].BGxVOFS,0) & 0x1FF; }
|
u32 getVOFS(int bg);
|
||||||
|
|
||||||
typedef u8 TBlendTable[32][32];
|
typedef u8 TBlendTable[32][32];
|
||||||
TBlendTable *blendTable;
|
TBlendTable *blendTable;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2011 DeSmuME team
|
Copyright (C) 2006-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GPU_osd.h"
|
#include "GPU_osd.h"
|
||||||
|
#include "driver.h"
|
||||||
#include "GPU.h"
|
#include "GPU.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include <string.h> //mem funcs
|
#include <string.h> //mem funcs
|
||||||
|
|
|
@ -23,13 +23,16 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include "armcpu.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "driver.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
#include "wifi.h"
|
#include "wifi.h"
|
||||||
#include "registers.h"
|
#include "registers.h"
|
||||||
#include "render3D.h"
|
#include "render3D.h"
|
||||||
|
#include "FIFO.h"
|
||||||
#include "gfx3d.h"
|
#include "gfx3d.h"
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
#include "mc.h"
|
#include "mc.h"
|
||||||
|
@ -41,6 +44,8 @@
|
||||||
#include "MMU_timing.h"
|
#include "MMU_timing.h"
|
||||||
#include "firmware.h"
|
#include "firmware.h"
|
||||||
#include "encrypt.h"
|
#include "encrypt.h"
|
||||||
|
#include "GPU.h"
|
||||||
|
#include "SPU.h"
|
||||||
|
|
||||||
#ifdef DO_ASSERT_UNALIGNED
|
#ifdef DO_ASSERT_UNALIGNED
|
||||||
#define ASSERT_UNALIGNED(x) assert(x)
|
#define ASSERT_UNALIGNED(x) assert(x)
|
||||||
|
@ -1259,6 +1264,29 @@ void MMU_GC_endTransfer(u32 PROCNUM)
|
||||||
NDS_makeIrq(PROCNUM, IRQ_BIT_GC_TRANSFER_COMPLETE);
|
NDS_makeIrq(PROCNUM, IRQ_BIT_GC_TRANSFER_COMPLETE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GC_Command::print()
|
||||||
|
{
|
||||||
|
GCLOG("%02X%02X%02X%02X%02X%02X%02X%02X\n",bytes[0],bytes[1],bytes[2],bytes[3],bytes[4],bytes[5],bytes[6],bytes[7]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GC_Command::toCryptoBuffer(u32 buf[2])
|
||||||
|
{
|
||||||
|
u8 temp[8] = { bytes[7], bytes[6], bytes[5], bytes[4], bytes[3], bytes[2], bytes[1], bytes[0] };
|
||||||
|
buf[0] = T1ReadLong(temp,0);
|
||||||
|
buf[1] = T1ReadLong(temp,4);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GC_Command::fromCryptoBuffer(u32 buf[2])
|
||||||
|
{
|
||||||
|
bytes[7] = (buf[0]>>0)&0xFF;
|
||||||
|
bytes[6] = (buf[0]>>8)&0xFF;
|
||||||
|
bytes[5] = (buf[0]>>16)&0xFF;
|
||||||
|
bytes[4] = (buf[0]>>24)&0xFF;
|
||||||
|
bytes[3] = (buf[1]>>0)&0xFF;
|
||||||
|
bytes[2] = (buf[1]>>8)&0xFF;
|
||||||
|
bytes[1] = (buf[1]>>16)&0xFF;
|
||||||
|
bytes[0] = (buf[1]>>24)&0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
template<int PROCNUM>
|
template<int PROCNUM>
|
||||||
void FASTCALL MMU_writeToGCControl(u32 val)
|
void FASTCALL MMU_writeToGCControl(u32 val)
|
||||||
|
@ -2057,6 +2085,11 @@ u32 MMU_struct_new::read_dma(const int proc, const int size, const u32 _adr)
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MMU_struct_new::is_dma(const u32 adr)
|
||||||
|
{
|
||||||
|
return adr >= _REG_DMA_CONTROL_MIN && adr <= _REG_DMA_CONTROL_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
MMU_struct_new::MMU_struct_new()
|
MMU_struct_new::MMU_struct_new()
|
||||||
{
|
{
|
||||||
for(int i=0;i<2;i++)
|
for(int i=0;i<2;i++)
|
||||||
|
@ -2066,6 +2099,36 @@ MMU_struct_new::MMU_struct_new()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivController::savestate(EMUFILE* os)
|
||||||
|
{
|
||||||
|
write8le(&mode,os);
|
||||||
|
write8le(&busy,os);
|
||||||
|
write8le(&div0,os);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DivController::loadstate(EMUFILE* is, int version)
|
||||||
|
{
|
||||||
|
int ret = 1;
|
||||||
|
ret &= read8le(&mode,is);
|
||||||
|
ret &= read8le(&busy,is);
|
||||||
|
ret &= read8le(&div0,is);
|
||||||
|
return ret==1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SqrtController::savestate(EMUFILE* os)
|
||||||
|
{
|
||||||
|
write8le(&mode,os);
|
||||||
|
write8le(&busy,os);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SqrtController::loadstate(EMUFILE* is, int version)
|
||||||
|
{
|
||||||
|
int ret=1;
|
||||||
|
ret &= read8le(&mode,is);
|
||||||
|
ret &= read8le(&busy,is);
|
||||||
|
return ret==1;
|
||||||
|
}
|
||||||
|
|
||||||
bool DmaController::loadstate(EMUFILE* f)
|
bool DmaController::loadstate(EMUFILE* f)
|
||||||
{
|
{
|
||||||
u32 version;
|
u32 version;
|
||||||
|
|
|
@ -20,14 +20,10 @@
|
||||||
#ifndef MMU_H
|
#ifndef MMU_H
|
||||||
#define MMU_H
|
#define MMU_H
|
||||||
|
|
||||||
#include "FIFO.h"
|
|
||||||
#include "mem.h"
|
|
||||||
#include "registers.h"
|
|
||||||
#include "mc.h"
|
|
||||||
#include "bits.h"
|
|
||||||
#include "readwrite.h"
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "firmware.h"
|
#include "firmware.h"
|
||||||
|
#include "mc.h"
|
||||||
|
#include "mem.h"
|
||||||
|
|
||||||
#ifdef HAVE_LUA
|
#ifdef HAVE_LUA
|
||||||
#include "lua-engine.h"
|
#include "lua-engine.h"
|
||||||
|
@ -41,8 +37,9 @@
|
||||||
#define ARMCPU_ARM9 0
|
#define ARMCPU_ARM9 0
|
||||||
#define ARMPROC (PROCNUM ? NDS_ARM7:NDS_ARM9)
|
#define ARMPROC (PROCNUM ? NDS_ARM7:NDS_ARM9)
|
||||||
|
|
||||||
typedef const u8 TWaitState;
|
class EMUFILE;
|
||||||
|
|
||||||
|
typedef const u8 TWaitState;
|
||||||
|
|
||||||
enum EDMAMode
|
enum EDMAMode
|
||||||
{
|
{
|
||||||
|
@ -152,20 +149,8 @@ public:
|
||||||
mode = val&3;
|
mode = val&3;
|
||||||
//todo - do we clear the div0 flag here or is that strictly done by the divider unit?
|
//todo - do we clear the div0 flag here or is that strictly done by the divider unit?
|
||||||
}
|
}
|
||||||
void savestate(EMUFILE* os)
|
void savestate(EMUFILE* os);
|
||||||
{
|
bool loadstate(EMUFILE* is, int version);
|
||||||
write8le(&mode,os);
|
|
||||||
write8le(&busy,os);
|
|
||||||
write8le(&div0,os);
|
|
||||||
}
|
|
||||||
bool loadstate(EMUFILE* is, int version)
|
|
||||||
{
|
|
||||||
int ret = 1;
|
|
||||||
ret &= read8le(&mode,is);
|
|
||||||
ret &= read8le(&busy,is);
|
|
||||||
ret &= read8le(&div0,is);
|
|
||||||
return ret==1;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SqrtController
|
class SqrtController
|
||||||
|
@ -178,18 +163,8 @@ public:
|
||||||
u8 mode, busy;
|
u8 mode, busy;
|
||||||
u16 read16() { return mode|(busy<<15); }
|
u16 read16() { return mode|(busy<<15); }
|
||||||
void write16(u16 val) { mode = val&1; }
|
void write16(u16 val) { mode = val&1; }
|
||||||
void savestate(EMUFILE* os)
|
void savestate(EMUFILE* os);
|
||||||
{
|
bool loadstate(EMUFILE* is, int version);
|
||||||
write8le(&mode,os);
|
|
||||||
write8le(&busy,os);
|
|
||||||
}
|
|
||||||
bool loadstate(EMUFILE* is, int version)
|
|
||||||
{
|
|
||||||
int ret=1;
|
|
||||||
ret &= read8le(&mode,is);
|
|
||||||
ret &= read8le(&busy,is);
|
|
||||||
return ret==1;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -324,27 +299,10 @@ void MMU_GC_endTransfer(u32 PROCNUM);
|
||||||
struct GC_Command
|
struct GC_Command
|
||||||
{
|
{
|
||||||
u8 bytes[8];
|
u8 bytes[8];
|
||||||
void print()
|
|
||||||
{
|
void print();
|
||||||
GCLOG("%02X%02X%02X%02X%02X%02X%02X%02X\n",bytes[0],bytes[1],bytes[2],bytes[3],bytes[4],bytes[5],bytes[6],bytes[7]);
|
void toCryptoBuffer(u32 buf[2]);
|
||||||
}
|
void fromCryptoBuffer(u32 buf[2]);
|
||||||
void toCryptoBuffer(u32 buf[2])
|
|
||||||
{
|
|
||||||
u8 temp[8] = { bytes[7], bytes[6], bytes[5], bytes[4], bytes[3], bytes[2], bytes[1], bytes[0] };
|
|
||||||
buf[0] = T1ReadLong(temp,0);
|
|
||||||
buf[1] = T1ReadLong(temp,4);
|
|
||||||
}
|
|
||||||
void fromCryptoBuffer(u32 buf[2])
|
|
||||||
{
|
|
||||||
bytes[7] = (buf[0]>>0)&0xFF;
|
|
||||||
bytes[6] = (buf[0]>>8)&0xFF;
|
|
||||||
bytes[5] = (buf[0]>>16)&0xFF;
|
|
||||||
bytes[4] = (buf[0]>>24)&0xFF;
|
|
||||||
bytes[3] = (buf[1]>>0)&0xFF;
|
|
||||||
bytes[2] = (buf[1]>>8)&0xFF;
|
|
||||||
bytes[1] = (buf[1]>>16)&0xFF;
|
|
||||||
bytes[0] = (buf[1]>>24)&0xFF;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//should rather be known as GCBUS controller, or somesuch
|
//should rather be known as GCBUS controller, or somesuch
|
||||||
|
@ -506,14 +464,15 @@ struct MMU_struct_new
|
||||||
|
|
||||||
void write_dma(const int proc, const int size, const u32 adr, const u32 val);
|
void write_dma(const int proc, const int size, const u32 adr, const u32 val);
|
||||||
u32 read_dma(const int proc, const int size, const u32 adr);
|
u32 read_dma(const int proc, const int size, const u32 adr);
|
||||||
bool is_dma(const u32 adr) { return adr >= _REG_DMA_CONTROL_MIN && adr <= _REG_DMA_CONTROL_MAX; }
|
bool is_dma(const u32 adr);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern MMU_struct MMU;
|
extern MMU_struct MMU;
|
||||||
extern MMU_struct_new MMU_new;
|
extern MMU_struct_new MMU_new;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
struct armcpu_memory_iface
|
||||||
|
{
|
||||||
/** the 32 bit instruction prefetch */
|
/** the 32 bit instruction prefetch */
|
||||||
u32 FASTCALL (*prefetch32)( void *data, u32 adr);
|
u32 FASTCALL (*prefetch32)( void *data, u32 adr);
|
||||||
|
|
||||||
|
@ -535,7 +494,7 @@ typedef struct {
|
||||||
void FASTCALL (*write32)( void *data, u32 adr, u32 val);
|
void FASTCALL (*write32)( void *data, u32 adr, u32 val);
|
||||||
|
|
||||||
void *data;
|
void *data;
|
||||||
} armcpu_memory_iface;
|
};
|
||||||
|
|
||||||
|
|
||||||
void MMU_Init(void);
|
void MMU_Init(void);
|
||||||
|
|
|
@ -16,34 +16,44 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "NDSSystem.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
|
#include "utils/decrypt/decrypt.h"
|
||||||
|
#include "utils/decrypt/crc.h"
|
||||||
|
#include "utils/advanscene.h"
|
||||||
|
#include "utils/task.h"
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "NDSSystem.h"
|
#include "armcpu.h"
|
||||||
#include "render3D.h"
|
#include "render3D.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "ROMReader.h"
|
#include "ROMReader.h"
|
||||||
#include "gfx3d.h"
|
#include "gfx3d.h"
|
||||||
#include "utils/decrypt/decrypt.h"
|
#include "GPU.h"
|
||||||
#include "utils/decrypt/crc.h"
|
|
||||||
#include "utils/advanscene.h"
|
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
#include "bios.h"
|
#include "bios.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "cheatSystem.h"
|
#include "cheatSystem.h"
|
||||||
#include "movie.h"
|
#include "movie.h"
|
||||||
#include "Disassembler.h"
|
#include "Disassembler.h"
|
||||||
|
#include "FIFO.h"
|
||||||
#include "readwrite.h"
|
#include "readwrite.h"
|
||||||
|
#include "registers.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "driver.h"
|
||||||
#include "firmware.h"
|
#include "firmware.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "slot1.h"
|
#include "slot1.h"
|
||||||
#include "slot2.h"
|
#include "slot2.h"
|
||||||
|
#include "SPU.h"
|
||||||
|
#include "wifi.h"
|
||||||
|
|
||||||
//int xxctr=0;
|
//int xxctr=0;
|
||||||
//#define LOG_ARM9
|
//#define LOG_ARM9
|
||||||
|
@ -100,6 +110,16 @@ void Desmume_InitOnce()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int NDS_GetCPUCoreCount()
|
||||||
|
{
|
||||||
|
return getOnlineCores();
|
||||||
|
}
|
||||||
|
|
||||||
|
void NDS_SetupDefaultFirmware()
|
||||||
|
{
|
||||||
|
NDS_FillDefaultFirmwareConfigData(&CommonSettings.fw_config);
|
||||||
|
}
|
||||||
|
|
||||||
void NDS_RunAdvansceneAutoImport()
|
void NDS_RunAdvansceneAutoImport()
|
||||||
{
|
{
|
||||||
if(CommonSettings.run_advanscene_import != "")
|
if(CommonSettings.run_advanscene_import != "")
|
||||||
|
@ -545,6 +565,16 @@ u32 GameInfo::readROM(u32 pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GameInfo::isDSiEnhanced()
|
||||||
|
{
|
||||||
|
return _isDSiEnhanced;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GameInfo::isHomebrew()
|
||||||
|
{
|
||||||
|
return ((header.ARM9src < 0x4000) && (T1ReadLong(header.logo, 0) != 0x51AEFF24) && (T1ReadLong(header.logo, 4) != 0x699AA221));
|
||||||
|
}
|
||||||
|
|
||||||
static int rom_init_path(const char *filename, const char *physicalName, const char *logicalFilename)
|
static int rom_init_path(const char *filename, const char *physicalName, const char *logicalFilename)
|
||||||
{
|
{
|
||||||
u32 type = ROM_NDS;
|
u32 type = ROM_NDS;
|
||||||
|
@ -2828,6 +2858,13 @@ void NDS_suspendProcessingInput(bool suspend)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NDS_swapScreen()
|
||||||
|
{
|
||||||
|
u16 tmp = MainScreen.offset;
|
||||||
|
MainScreen.offset = SubScreen.offset;
|
||||||
|
SubScreen.offset = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void emu_halt() {
|
void emu_halt() {
|
||||||
//printf("halting emu: ARM9 PC=%08X/%08X, ARM7 PC=%08X/%08X\n", NDS_ARM9.R[15], NDS_ARM9.instruct_adr, NDS_ARM7.R[15], NDS_ARM7.instruct_adr);
|
//printf("halting emu: ARM9 PC=%08X/%08X, ARM7 PC=%08X/%08X\n", NDS_ARM9.R[15], NDS_ARM9.instruct_adr, NDS_ARM7.R[15], NDS_ARM7.instruct_adr);
|
||||||
|
|
|
@ -20,23 +20,13 @@
|
||||||
#define NDSSYSTEM_H
|
#define NDSSYSTEM_H
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "armcpu.h"
|
|
||||||
#include "MMU.h"
|
|
||||||
#include "driver.h"
|
|
||||||
#include "GPU.h"
|
|
||||||
#include "SPU.h"
|
|
||||||
#include "mem.h"
|
|
||||||
#include "wifi.h"
|
|
||||||
#include "emufile.h"
|
|
||||||
#include "firmware.h"
|
|
||||||
#include "types.h"
|
|
||||||
#include "utils/task.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#if defined(HOST_WINDOWS) && !defined(DESMUME_QT)
|
#include "types.h"
|
||||||
#include "pathsettings.h"
|
|
||||||
#endif
|
class BaseDriver;
|
||||||
|
class CFIRMWARE;
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
template<typename Type>
|
template<typename Type>
|
||||||
struct buttonstruct {
|
struct buttonstruct {
|
||||||
|
@ -81,6 +71,7 @@ extern BOOL click;
|
||||||
#define NDS_FW_LANG_CHI 6
|
#define NDS_FW_LANG_CHI 6
|
||||||
#define NDS_FW_LANG_RES 7
|
#define NDS_FW_LANG_RES 7
|
||||||
|
|
||||||
|
extern BaseDriver *driver;
|
||||||
extern CFIRMWARE *firmware;
|
extern CFIRMWARE *firmware;
|
||||||
|
|
||||||
#define DSGBA_LOADER_SIZE 512
|
#define DSGBA_LOADER_SIZE 512
|
||||||
|
@ -363,8 +354,8 @@ struct GameInfo
|
||||||
void closeROM();
|
void closeROM();
|
||||||
u32 readROM(u32 pos);
|
u32 readROM(u32 pos);
|
||||||
void populate();
|
void populate();
|
||||||
bool isDSiEnhanced() { return _isDSiEnhanced; };
|
bool isDSiEnhanced();
|
||||||
bool isHomebrew() { return ((header.ARM9src < 0x4000) && (T1ReadLong(header.logo, 0) != 0x51AEFF24) && (T1ReadLong(header.logo, 4) != 0x699AA221)); }
|
bool isHomebrew();
|
||||||
bool hasRomBanner();
|
bool hasRomBanner();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -470,19 +461,15 @@ void NDS_debug_break();
|
||||||
void NDS_debug_continue();
|
void NDS_debug_continue();
|
||||||
void NDS_debug_step();
|
void NDS_debug_step();
|
||||||
|
|
||||||
void execHardware_doAllDma(EDMAMode modeNum);
|
int NDS_GetCPUCoreCount();
|
||||||
|
void NDS_SetupDefaultFirmware();
|
||||||
|
|
||||||
|
//void execHardware_doAllDma(EDMAMode modeNum);
|
||||||
|
|
||||||
template<bool FORCE> void NDS_exec(s32 nb = 560190<<1);
|
template<bool FORCE> void NDS_exec(s32 nb = 560190<<1);
|
||||||
|
|
||||||
extern int lagframecounter;
|
extern int lagframecounter;
|
||||||
|
|
||||||
static INLINE void NDS_swapScreen(void)
|
|
||||||
{
|
|
||||||
u16 tmp = MainScreen.offset;
|
|
||||||
MainScreen.offset = SubScreen.offset;
|
|
||||||
SubScreen.offset = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern struct TCommonSettings {
|
extern struct TCommonSettings {
|
||||||
TCommonSettings()
|
TCommonSettings()
|
||||||
: GFX3D_HighResolutionInterpolateColor(true)
|
: GFX3D_HighResolutionInterpolateColor(true)
|
||||||
|
@ -507,7 +494,7 @@ extern struct TCommonSettings {
|
||||||
, rigorous_timing(false)
|
, rigorous_timing(false)
|
||||||
, advanced_timing(true)
|
, advanced_timing(true)
|
||||||
, micMode(InternalNoise)
|
, micMode(InternalNoise)
|
||||||
, spuInterpolationMode(SPUInterpolation_Linear)
|
, spuInterpolationMode(1)
|
||||||
, manualBackupType(0)
|
, manualBackupType(0)
|
||||||
, autodetectBackupMethod(0)
|
, autodetectBackupMethod(0)
|
||||||
, spu_captureMuted(false)
|
, spu_captureMuted(false)
|
||||||
|
@ -522,7 +509,6 @@ extern struct TCommonSettings {
|
||||||
strcpy(ARM9BIOS, "biosnds9.bin");
|
strcpy(ARM9BIOS, "biosnds9.bin");
|
||||||
strcpy(ARM7BIOS, "biosnds7.bin");
|
strcpy(ARM7BIOS, "biosnds7.bin");
|
||||||
strcpy(Firmware, "firmware.bin");
|
strcpy(Firmware, "firmware.bin");
|
||||||
NDS_FillDefaultFirmwareConfigData(&fw_config);
|
|
||||||
|
|
||||||
/* WIFI mode: adhoc = 0, infrastructure = 1 */
|
/* WIFI mode: adhoc = 0, infrastructure = 1 */
|
||||||
wifi.mode = 1;
|
wifi.mode = 1;
|
||||||
|
@ -542,7 +528,8 @@ extern struct TCommonSettings {
|
||||||
use_jit = false;
|
use_jit = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
num_cores = getOnlineCores();
|
num_cores = NDS_GetCPUCoreCount();
|
||||||
|
NDS_SetupDefaultFirmware();
|
||||||
}
|
}
|
||||||
bool GFX3D_HighResolutionInterpolateColor;
|
bool GFX3D_HighResolutionInterpolateColor;
|
||||||
bool GFX3D_EdgeMark;
|
bool GFX3D_EdgeMark;
|
||||||
|
@ -601,7 +588,7 @@ extern struct TCommonSettings {
|
||||||
} micMode;
|
} micMode;
|
||||||
|
|
||||||
|
|
||||||
SPUInterpolationMode spuInterpolationMode;
|
int spuInterpolationMode;
|
||||||
|
|
||||||
//this is a temporary hack until we straighten out the flushing logic and/or gxfifo
|
//this is a temporary hack until we straighten out the flushing logic and/or gxfifo
|
||||||
//int gfx3d_flushMode;
|
//int gfx3d_flushMode;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2007 shash
|
Copyright (C) 2006-2007 shash
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include "OGLRender.h"
|
#include "OGLRender.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006 Theo Berkau
|
Copyright (C) 2006 Theo Berkau
|
||||||
Copyright (C) 2008-2012 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
Ideas borrowed from Stephane Dallongeville's SCSP core
|
Ideas borrowed from Stephane Dallongeville's SCSP core
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "driver.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "SPU.h"
|
#include "SPU.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2006 Theo Berkau
|
Copyright 2006 Theo Berkau
|
||||||
Copyright (C) 2006-2010 DeSmuME team
|
Copyright (C) 2006-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,11 +22,13 @@
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "emufile.h"
|
|
||||||
#include "metaspu/metaspu.h"
|
#include "metaspu/metaspu.h"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
#define SNDCORE_DEFAULT -1
|
#define SNDCORE_DEFAULT -1
|
||||||
#define SNDCORE_DUMMY 0
|
#define SNDCORE_DUMMY 0
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2010-2013 DeSmuME team
|
Copyright (C) 2010-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,9 +16,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../slot1.h"
|
#include "../slot1.h"
|
||||||
#include "../registers.h"
|
|
||||||
#include "../MMU.h"
|
|
||||||
#include "../NDSSystem.h"
|
|
||||||
|
|
||||||
class Slot1_None : public ISlot1Interface
|
class Slot1_None : public ISlot1Interface
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2010-2013 DeSmuME team
|
Copyright (C) 2010-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,14 +15,13 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "slot1comp_protocol.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "../slot1.h"
|
#include "../slot1.h"
|
||||||
#include "../registers.h"
|
|
||||||
#include "../MMU.h"
|
|
||||||
#include "../NDSSystem.h"
|
#include "../NDSSystem.h"
|
||||||
#include "../emufile.h"
|
#include "../emufile.h"
|
||||||
#include "slot1comp_protocol.h"
|
|
||||||
|
|
||||||
class Slot1_R4 : public ISlot1Interface, public ISlot1Comp_Protocol_Client
|
class Slot1_R4 : public ISlot1Interface, public ISlot1Comp_Protocol_Client
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2013 DeSmuME team
|
Copyright (C) 2013-2105 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,8 +16,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../slot1.h"
|
#include "../slot1.h"
|
||||||
#include "../registers.h"
|
|
||||||
#include "../MMU.h"
|
|
||||||
#include "../NDSSystem.h"
|
#include "../NDSSystem.h"
|
||||||
|
|
||||||
class Slot1_Retail_Auto : public ISlot1Interface
|
class Slot1_Retail_Auto : public ISlot1Interface
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2010-2013 DeSmuME team
|
Copyright (C) 2010-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,14 +15,13 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../slot1.h"
|
|
||||||
#include "../registers.h"
|
|
||||||
#include "../MMU.h"
|
|
||||||
#include "../NDSSystem.h"
|
|
||||||
#include "slot1comp_mc.h"
|
#include "slot1comp_mc.h"
|
||||||
#include "slot1comp_rom.h"
|
#include "slot1comp_rom.h"
|
||||||
#include "slot1comp_protocol.h"
|
#include "slot1comp_protocol.h"
|
||||||
|
|
||||||
|
#include "../slot1.h"
|
||||||
|
#include "../NDSSystem.h"
|
||||||
|
|
||||||
//quick architecture overview:
|
//quick architecture overview:
|
||||||
//MCROM receives GC bus commands from MMU.cpp
|
//MCROM receives GC bus commands from MMU.cpp
|
||||||
//those are passed on to the protocol component for parsing
|
//those are passed on to the protocol component for parsing
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2013 DeSmuME team
|
Copyright (C) 2013-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,16 +15,18 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../slot1.h"
|
|
||||||
#include "../registers.h"
|
|
||||||
#include "../MMU.h"
|
|
||||||
#include "../NDSSystem.h"
|
|
||||||
#include "../utils/fsnitro.h"
|
|
||||||
#include "../path.h"
|
|
||||||
#include "slot1comp_mc.h"
|
#include "slot1comp_mc.h"
|
||||||
#include "slot1comp_rom.h"
|
#include "slot1comp_rom.h"
|
||||||
#include "slot1comp_protocol.h"
|
#include "slot1comp_protocol.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "../slot1.h"
|
||||||
|
#include "../path.h"
|
||||||
|
#include "../NDSSystem.h"
|
||||||
|
#include "../utils/fsnitro.h"
|
||||||
|
|
||||||
//quick architecture overview:
|
//quick architecture overview:
|
||||||
//MCROM receives GC bus commands from MMU.cpp
|
//MCROM receives GC bus commands from MMU.cpp
|
||||||
//those are passed on to the protocol component for parsing
|
//those are passed on to the protocol component for parsing
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2010-2013 DeSmuME team
|
Copyright (C) 2010-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -21,13 +21,13 @@
|
||||||
// NTR-UORE-0
|
// NTR-UORE-0
|
||||||
// - 128Mbit
|
// - 128Mbit
|
||||||
|
|
||||||
#include "../slot1.h"
|
|
||||||
#include "../registers.h"
|
|
||||||
#include "../MMU.h"
|
|
||||||
#include "../NDSSystem.h"
|
|
||||||
#include "slot1comp_rom.h"
|
#include "slot1comp_rom.h"
|
||||||
#include "slot1comp_protocol.h"
|
#include "slot1comp_protocol.h"
|
||||||
|
|
||||||
|
#include "../slot1.h"
|
||||||
|
#include "../NDSSystem.h"
|
||||||
|
#include "../emufile.h"
|
||||||
|
|
||||||
//quick architecture overview:
|
//quick architecture overview:
|
||||||
//NAND receives GC bus commands from MMU.cpp
|
//NAND receives GC bus commands from MMU.cpp
|
||||||
//those are passed on to the protocol component for parsing
|
//those are passed on to the protocol component for parsing
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2013 DeSmuME team
|
Copyright (C) 2013-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,10 +18,10 @@
|
||||||
//this file contains the components used for emulating standard gamecard "MC" devices (eeprom, fram, flash)
|
//this file contains the components used for emulating standard gamecard "MC" devices (eeprom, fram, flash)
|
||||||
//this is largely done by accessing the BackupDevice resources in the core emulator
|
//this is largely done by accessing the BackupDevice resources in the core emulator
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
#include "../MMU.h"
|
|
||||||
#include "slot1comp_mc.h"
|
#include "slot1comp_mc.h"
|
||||||
#include "NDSSystem.h"
|
|
||||||
|
#include "../MMU.h"
|
||||||
|
#include "../NDSSystem.h"
|
||||||
|
|
||||||
Slot1Comp_MC g_Slot1Comp_MC;
|
Slot1Comp_MC g_Slot1Comp_MC;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2013 DeSmuME team
|
Copyright (C) 2013-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,6 +17,11 @@
|
||||||
|
|
||||||
//this file contains the components used for emulating standard gamecard "MC" devices (eeprom, fram, flash)
|
//this file contains the components used for emulating standard gamecard "MC" devices (eeprom, fram, flash)
|
||||||
|
|
||||||
|
#ifndef _SLOT1COMP_MC_H
|
||||||
|
#define _SLOT1COMP_MC_H
|
||||||
|
|
||||||
|
#include "../types.h"
|
||||||
|
|
||||||
class Slot1Comp_MC
|
class Slot1Comp_MC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -26,3 +31,5 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Slot1Comp_MC g_Slot1Comp_MC;
|
extern Slot1Comp_MC g_Slot1Comp_MC;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2012-2013 DeSmuME team
|
Copyright (C) 2012-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,9 +16,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "slot1comp_protocol.h"
|
#include "slot1comp_protocol.h"
|
||||||
#include "MMU.h"
|
|
||||||
#include "armcpu.h"
|
#include <string.h>
|
||||||
#include "encrypt.h"
|
|
||||||
|
#include "../armcpu.h"
|
||||||
|
#include "../encrypt.h"
|
||||||
|
#include "../emufile.h"
|
||||||
#include "../utils/decrypt/decrypt.h"
|
#include "../utils/decrypt/decrypt.h"
|
||||||
|
|
||||||
static _KEY1 key1((const u8*)arm7_key);
|
static _KEY1 key1((const u8*)arm7_key);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2013 DeSmuME team
|
Copyright (C) 2013-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -23,7 +23,10 @@
|
||||||
#ifndef _SLOT1COMP_PROTOCOL_H
|
#ifndef _SLOT1COMP_PROTOCOL_H
|
||||||
#define _SLOT1COMP_PROTOCOL_H
|
#define _SLOT1COMP_PROTOCOL_H
|
||||||
|
|
||||||
#include "MMU.h"
|
#include "../types.h"
|
||||||
|
#include "../MMU.h"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
enum eSlot1Operation
|
enum eSlot1Operation
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2010-2013 DeSmuME team
|
Copyright (C) 2010-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,8 +16,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "slot1comp_rom.h"
|
#include "slot1comp_rom.h"
|
||||||
#include "MMU.h"
|
|
||||||
#include "NDSSystem.h"
|
#include "../NDSSystem.h"
|
||||||
|
#include "../emufile.h"
|
||||||
|
|
||||||
|
|
||||||
void Slot1Comp_Rom::start(eSlot1Operation operation, u32 addr)
|
void Slot1Comp_Rom::start(eSlot1Operation operation, u32 addr)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2010-2013 DeSmuME team
|
Copyright (C) 2010-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,8 +18,13 @@
|
||||||
//this file contains the components used for emulating standard gamecard ROMs
|
//this file contains the components used for emulating standard gamecard ROMs
|
||||||
//this is largely done by accessing the rom provided in the core emulator
|
//this is largely done by accessing the rom provided in the core emulator
|
||||||
|
|
||||||
|
#ifndef _SLOT1COMP_ROM_H
|
||||||
|
#define _SLOT1COMP_ROM_H
|
||||||
|
|
||||||
#include "slot1comp_protocol.h"
|
#include "slot1comp_protocol.h"
|
||||||
#include "emufile.h"
|
#include "../types.h"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
class Slot1Comp_Rom
|
class Slot1Comp_Rom
|
||||||
{
|
{
|
||||||
|
@ -37,3 +42,4 @@ private:
|
||||||
eSlot1Operation operation;
|
eSlot1Operation operation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2013 DeSmuME team
|
Copyright (C) 2013-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,10 +15,9 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../slot2.h"
|
#include <stdio.h>
|
||||||
#include "../registers.h"
|
|
||||||
#include "../MMU.h"
|
|
||||||
|
|
||||||
|
#include "../slot2.h"
|
||||||
|
|
||||||
class Slot2_Auto : public ISlot2Interface
|
class Slot2_Auto : public ISlot2Interface
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009 CrazyMax
|
Copyright (C) 2009 CrazyMax
|
||||||
Copyright (C) 2009-2013 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,6 +17,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../slot2.h"
|
#include "../slot2.h"
|
||||||
|
#include "../emufile.h"
|
||||||
|
#include "../mem.h"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define EXPINFO(...) INFO(__VA_ARGS__)
|
#define EXPINFO(...) INFO(__VA_ARGS__)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009 CrazyMax
|
Copyright (C) 2009 CrazyMax
|
||||||
Copyright (C) 2009-2014 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,12 +16,13 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "../slot2.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../mem.h"
|
|
||||||
#include "../MMU.h"
|
#include "../debug.h"
|
||||||
#include "../NDSSystem.h"
|
#include "../NDSSystem.h"
|
||||||
#include "../path.h"
|
#include "../path.h"
|
||||||
#include "../slot2.h"
|
|
||||||
#include "../emufile.h"
|
#include "../emufile.h"
|
||||||
|
|
||||||
#define EEPROM 0x52504545
|
#define EEPROM 0x52504545
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006 Mic
|
Copyright (C) 2006 Mic
|
||||||
Copyright (C) 2009-2013 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,11 +22,12 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "../types.h"
|
|
||||||
|
#include "../slot2.h"
|
||||||
#include "../debug.h"
|
#include "../debug.h"
|
||||||
|
#include "../emufile.h"
|
||||||
#include "../path.h"
|
#include "../path.h"
|
||||||
#include "../utils/vfat.h"
|
#include "../utils/vfat.h"
|
||||||
#include "../slot2.h"
|
|
||||||
|
|
||||||
// Set up addresses for GBAMP
|
// Set up addresses for GBAMP
|
||||||
#define CF_REG_DATA 0x9000000
|
#define CF_REG_DATA 0x9000000
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011-2013 DeSmuME team
|
Copyright (C) 2011-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -38,8 +38,9 @@ maybe legally configure the paddle differently, which could be rejected here; in
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../NDSSystem.h"
|
|
||||||
#include "../slot2.h"
|
#include "../slot2.h"
|
||||||
|
#include "../NDSSystem.h"
|
||||||
|
|
||||||
class Slot2_Paddle : public ISlot2Interface
|
class Slot2_Paddle : public ISlot2Interface
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2013 DeSmuME team
|
Copyright (C) 2013-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,9 +15,8 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../NDSSystem.h"
|
|
||||||
#include "../types.h"
|
|
||||||
#include "../slot2.h"
|
#include "../slot2.h"
|
||||||
|
#include "../NDSSystem.h"
|
||||||
|
|
||||||
class Slot2_PassME : public ISlot2Interface
|
class Slot2_PassME : public ISlot2Interface
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2007 shash
|
Copyright (C) 2006-2007 shash
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
// of current ones)
|
// of current ones)
|
||||||
|
|
||||||
//#define UNTESTEDOPCODEDEBUG
|
//#define UNTESTEDOPCODEDEBUG
|
||||||
|
#include "instructions.h"
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Copyright (C) 2006 yopyop
|
/* Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2011 Loren Merritt
|
Copyright (C) 2011 Loren Merritt
|
||||||
Copyright (C) 2012-2013 DeSmuME team
|
Copyright (C) 2012-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
#define HAVE_STATIC_CODE_BUFFER
|
#define HAVE_STATIC_CODE_BUFFER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "armcpu.h"
|
||||||
#include "instructions.h"
|
#include "instructions.h"
|
||||||
#include "instruction_attributes.h"
|
#include "instruction_attributes.h"
|
||||||
#include "Disassembler.h"
|
#include "Disassembler.h"
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "types.h"
|
|
||||||
|
#include "armcpu.h"
|
||||||
|
#include "common.h"
|
||||||
#include "instructions.h"
|
#include "instructions.h"
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
#include "bios.h"
|
#include "bios.h"
|
||||||
|
@ -745,6 +747,33 @@ template u32 armcpu_exec<1,false>();
|
||||||
template u32 armcpu_exec<1,true>();
|
template u32 armcpu_exec<1,true>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void setIF(int PROCNUM, u32 flag)
|
||||||
|
{
|
||||||
|
//don't set generated bits!!!
|
||||||
|
assert(!(flag&0x00200000));
|
||||||
|
|
||||||
|
MMU.reg_IF_bits[PROCNUM] |= flag;
|
||||||
|
|
||||||
|
NDS_Reschedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
char* decodeIntruction(bool thumb_mode, u32 instr)
|
||||||
|
{
|
||||||
|
char txt[20] = {0};
|
||||||
|
u32 tmp = 0;
|
||||||
|
if (thumb_mode == true)
|
||||||
|
{
|
||||||
|
tmp = (instr >> 6);
|
||||||
|
strcpy(txt, intToBin((u16)tmp)+6);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tmp = ((instr >> 16) & 0x0FF0) | ((instr >> 4) & 0x0F);
|
||||||
|
strcpy(txt, intToBin((u32)tmp)+20);
|
||||||
|
}
|
||||||
|
return strdup(txt);
|
||||||
|
}
|
||||||
|
|
||||||
const armcpu_ctrl_iface arm_default_ctrl_iface = {
|
const armcpu_ctrl_iface arm_default_ctrl_iface = {
|
||||||
stall_cpu,
|
stall_cpu,
|
||||||
unstall_cpu,
|
unstall_cpu,
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "common.h"
|
|
||||||
#include "instructions.h"
|
|
||||||
#include "cp15.h"
|
|
||||||
|
|
||||||
#define CODE(i) (((i)>>25)&0x7)
|
#define CODE(i) (((i)>>25)&0x7)
|
||||||
#define OPCODE(i) (((i)>>21)&0xF)
|
#define OPCODE(i) (((i)>>21)&0xF)
|
||||||
|
@ -223,7 +220,8 @@ typedef union
|
||||||
/**
|
/**
|
||||||
* The control interface to a CPU
|
* The control interface to a CPU
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct armcpu_ctrl_iface
|
||||||
|
{
|
||||||
/** stall the processor */
|
/** stall the processor */
|
||||||
void (*stall)( void *instance);
|
void (*stall)( void *instance);
|
||||||
|
|
||||||
|
@ -246,7 +244,7 @@ typedef struct {
|
||||||
|
|
||||||
/** the private data passed to all interface functions */
|
/** the private data passed to all interface functions */
|
||||||
void *data;
|
void *data;
|
||||||
} armcpu_ctrl_iface;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef void* armcp_t;
|
typedef void* armcp_t;
|
||||||
|
@ -343,37 +341,12 @@ template<int PROCNUM> u32 armcpu_exec();
|
||||||
template<int PROCNUM, bool jit> u32 armcpu_exec();
|
template<int PROCNUM, bool jit> u32 armcpu_exec();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static INLINE void setIF(int PROCNUM, u32 flag)
|
void setIF(int PROCNUM, u32 flag);
|
||||||
{
|
char* decodeIntruction(bool thumb_mode, u32 instr);
|
||||||
//don't set generated bits!!!
|
|
||||||
assert(!(flag&0x00200000));
|
|
||||||
|
|
||||||
MMU.reg_IF_bits[PROCNUM] |= flag;
|
|
||||||
|
|
||||||
extern void NDS_Reschedule();
|
|
||||||
NDS_Reschedule();
|
|
||||||
}
|
|
||||||
|
|
||||||
static INLINE void NDS_makeIrq(int PROCNUM, u32 num)
|
static INLINE void NDS_makeIrq(int PROCNUM, u32 num)
|
||||||
{
|
{
|
||||||
setIF(PROCNUM,1<<num);
|
setIF(PROCNUM,1<<num);
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE char *decodeIntruction(bool thumb_mode, u32 instr)
|
|
||||||
{
|
|
||||||
char txt[20] = {0};
|
|
||||||
u32 tmp = 0;
|
|
||||||
if (thumb_mode == true)
|
|
||||||
{
|
|
||||||
tmp = (instr >> 6);
|
|
||||||
strcpy(txt, intToBin((u16)tmp)+6);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tmp = ((instr >> 16) & 0x0FF0) | ((instr >> 4) & 0x0F);
|
|
||||||
strcpy(txt, intToBin((u32)tmp)+20);
|
|
||||||
}
|
|
||||||
return strdup(txt);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -20,10 +20,12 @@
|
||||||
//it renders the use of bios files generally unnecessary.
|
//it renders the use of bios files generally unnecessary.
|
||||||
//it turns out that they're not too complex, although of course the timings will be all wrong here.
|
//it turns out that they're not too complex, although of course the timings will be all wrong here.
|
||||||
|
|
||||||
|
#include "armcpu.h"
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "registers.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
|
|
||||||
#define cpu (&ARMPROC)
|
#define cpu (&ARMPROC)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2012 DeSmuME team
|
Copyright (C) 2006-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
#ifndef BIOS_H
|
#ifndef BIOS_H
|
||||||
#define BIOS_H
|
#define BIOS_H
|
||||||
|
|
||||||
#include "armcpu.h"
|
#include "types.h"
|
||||||
|
|
||||||
extern u32 (* ARM_swi_tab[2][32])();
|
extern u32 (* ARM_swi_tab[2][32])();
|
||||||
extern const char* ARM_swi_names[2][32];
|
extern const char* ARM_swi_names[2][32];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2012 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,9 +15,11 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include "cheatSystem.h"
|
#include "cheatSystem.h"
|
||||||
|
#include "bits.h"
|
||||||
|
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
|
#include "common.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2012 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,10 +15,12 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "common.h"
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
#define CHEAT_VERSION_MAJOR 2
|
#define CHEAT_VERSION_MAJOR 2
|
||||||
#define CHEAT_VERSION_MINOR 0
|
#define CHEAT_VERSION_MINOR 0
|
||||||
|
|
|
@ -44,21 +44,25 @@
|
||||||
#define CLI_UI
|
#define CLI_UI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "MMU.h"
|
#include "../NDSSystem.h"
|
||||||
#include "NDSSystem.h"
|
#include "../driver.h"
|
||||||
#include "debug.h"
|
#include "../GPU.h"
|
||||||
#include "sndsdl.h"
|
#include "../SPU.h"
|
||||||
#include "ctrlssdl.h"
|
#include "../sndsdl.h"
|
||||||
#include "render3D.h"
|
#include "../ctrlssdl.h"
|
||||||
#include "rasterize.h"
|
#include "../render3D.h"
|
||||||
#include "saves.h"
|
#include "../rasterize.h"
|
||||||
#include "firmware.h"
|
#include "../saves.h"
|
||||||
#include "GPU_osd.h"
|
#include "../GPU_osd.h"
|
||||||
#include "desmume_config.h"
|
#include "../desmume_config.h"
|
||||||
#include "commandline.h"
|
#include "../commandline.h"
|
||||||
#include "slot2.h"
|
#include "../slot2.h"
|
||||||
#include "utils/xstring.h"
|
#include "../utils/xstring.h"
|
||||||
#include "gdbstub.h"
|
|
||||||
|
#ifdef GDB_STUB
|
||||||
|
#include "../armcpu.h"
|
||||||
|
#include "../gdbstub.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
volatile bool execute = false;
|
volatile bool execute = false;
|
||||||
|
|
||||||
|
@ -589,7 +593,7 @@ int main(int argc, char ** argv) {
|
||||||
g_thread_init( NULL);
|
g_thread_init( NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
driver = new UnixDriver();
|
driver = new BaseDriver();
|
||||||
|
|
||||||
#ifdef GDB_STUB
|
#ifdef GDB_STUB
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011 Roger Manuel
|
Copyright (C) 2011 Roger Manuel
|
||||||
Copyright (C) 2011-2014 DeSmuME team
|
Copyright (C) 2011-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,9 +17,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#include "../cheatSystem.h"
|
|
||||||
#undef BOOL
|
#undef BOOL
|
||||||
|
|
||||||
|
class CHEATS;
|
||||||
|
class CHEATS_LIST;
|
||||||
|
class CHEATSEARCH;
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************************
|
/********************************************************************************************
|
||||||
CocoaDSCheatItem - OBJECTIVE-C CLASS
|
CocoaDSCheatItem - OBJECTIVE-C CLASS
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011 Roger Manuel
|
Copyright (C) 2011 Roger Manuel
|
||||||
Copyright (C) 2012-2014 DeSmuME team
|
Copyright (C) 2012-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
#import "cocoa_globals.h"
|
#import "cocoa_globals.h"
|
||||||
#import "cocoa_util.h"
|
#import "cocoa_util.h"
|
||||||
|
|
||||||
|
#include "../cheatSystem.h"
|
||||||
#include "../MMU.h"
|
#include "../MMU.h"
|
||||||
|
|
||||||
@implementation CocoaDSCheatItem
|
@implementation CocoaDSCheatItem
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#include "../movie.h"
|
#include "../movie.h"
|
||||||
#include "../NDSSystem.h"
|
#include "../NDSSystem.h"
|
||||||
|
#include "../armcpu.h"
|
||||||
#include "../driver.h"
|
#include "../driver.h"
|
||||||
#include "../gdbstub.h"
|
#include "../gdbstub.h"
|
||||||
#include "../slot1.h"
|
#include "../slot1.h"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011 Roger Manuel
|
Copyright (C) 2011 Roger Manuel
|
||||||
Copyright (C) 2012 DeSmuME team
|
Copyright (C) 2012-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#import "cocoa_firmware.h"
|
#import "cocoa_firmware.h"
|
||||||
#include "../NDSSystem.h"
|
#include "../NDSSystem.h"
|
||||||
|
#include "../firmware.h"
|
||||||
|
|
||||||
|
|
||||||
@implementation CocoaDSFirmware
|
@implementation CocoaDSFirmware
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011 Roger Manuel
|
Copyright (C) 2011 Roger Manuel
|
||||||
Copyright (C) 2011-2014 DeSmuME team
|
Copyright (C) 2011-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
#include "sndOSX.h"
|
#include "sndOSX.h"
|
||||||
|
|
||||||
#include "../NDSSystem.h"
|
#include "../NDSSystem.h"
|
||||||
|
#include "../GPU.h"
|
||||||
#include "../SPU.h"
|
#include "../SPU.h"
|
||||||
#include "../metaspu/metaspu.h"
|
#include "../metaspu/metaspu.h"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011 Roger Manuel
|
Copyright (C) 2011 Roger Manuel
|
||||||
Copyright (C) 2011-2013 DeSmuME team
|
Copyright (C) 2011-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
#import "cocoa_util.h"
|
#import "cocoa_util.h"
|
||||||
|
|
||||||
#include "../NDSSystem.h"
|
#include "../NDSSystem.h"
|
||||||
#include "../MMU.h"
|
#include "../common.h"
|
||||||
#include "../mc.h"
|
#include "../mc.h"
|
||||||
#undef BOOL
|
#undef BOOL
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011 Roger Manuel
|
Copyright (C) 2011 Roger Manuel
|
||||||
Copyright (C) 2012-2013 DeSmuME team
|
Copyright (C) 2012-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,7 +18,8 @@
|
||||||
|
|
||||||
#import "cocoa_globals.h"
|
#import "cocoa_globals.h"
|
||||||
#include "mic_ext.h"
|
#include "mic_ext.h"
|
||||||
#include "readwrite.h"
|
#include "../emufile.h"
|
||||||
|
#include "../readwrite.h"
|
||||||
|
|
||||||
RingBuffer micInputBuffer(MIC_MAX_BUFFER_SAMPLES * 2, sizeof(u8));
|
RingBuffer micInputBuffer(MIC_MAX_BUFFER_SAMPLES * 2, sizeof(u8));
|
||||||
NullGenerator nullSampleGenerator;
|
NullGenerator nullSampleGenerator;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include "../../NDSSystem.h"
|
#include "../../NDSSystem.h"
|
||||||
|
#include "../../GPU.h"
|
||||||
#undef BOOL
|
#undef BOOL
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2008-2010 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,10 +17,11 @@
|
||||||
|
|
||||||
//TODO - move this into ndssystem where it belongs probably
|
//TODO - move this into ndssystem where it belongs probably
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "common.h"
|
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2008-2010 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,31 +22,13 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "types.h"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define CLASSNAME "DeSmuME"
|
#define CLASSNAME "DeSmuME"
|
||||||
|
|
||||||
extern HINSTANCE hAppInst;
|
|
||||||
|
|
||||||
extern bool romloaded;
|
|
||||||
|
|
||||||
extern char IniName[MAX_PATH];
|
|
||||||
extern void GetINIPath();
|
|
||||||
extern void WritePrivateProfileInt(char* appname, char* keyname, int val, char* file);
|
|
||||||
|
|
||||||
bool GetPrivateProfileBool(const char* appname, const char* keyname, bool defval, const char* filename);
|
|
||||||
void WritePrivateProfileBool(char* appname, char* keyname, bool val, char* file);
|
|
||||||
|
|
||||||
#else // non Windows
|
#else // non Windows
|
||||||
|
|
||||||
#define sscanf_s sscanf
|
#define sscanf_s sscanf
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2013 DeSmuME team
|
Copyright (C) 2006-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,9 +18,12 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "armcpu.h"
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
|
#include "emufile.h"
|
||||||
|
#include "readwrite.h"
|
||||||
|
|
||||||
armcp15_t cp15;
|
armcp15_t cp15;
|
||||||
|
|
||||||
|
@ -292,7 +295,7 @@ BOOL armcp15_t::moveCP2ARM(u32 * R, u8 CRn, u8 CRm, u8 opcode1, u8 opcode2)
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case 9:
|
case 9:
|
||||||
if((opcode1==0))
|
if(opcode1==0)
|
||||||
{
|
{
|
||||||
switch(CRm)
|
switch(CRm)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2013 DeSmuME team
|
Copyright (C) 2006-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -19,8 +19,10 @@
|
||||||
#ifndef __CP15_H__
|
#ifndef __CP15_H__
|
||||||
#define __CP15_H__
|
#define __CP15_H__
|
||||||
|
|
||||||
#include "armcpu.h"
|
#include <string.h>
|
||||||
#include "emufile.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
#define CP15_ACCESS_WRITE 0
|
#define CP15_ACCESS_WRITE 0
|
||||||
#define CP15_ACCESS_READ 2
|
#define CP15_ACCESS_READ 2
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 Guillaume Duhamel
|
Copyright (C) 2006 Guillaume Duhamel
|
||||||
Copyright (C) 2006-2011 DeSmuME team
|
Copyright (C) 2006-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -26,7 +26,9 @@
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "emufile.h"
|
|
||||||
|
struct armcpu_t;
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
struct DebugStatistics
|
struct DebugStatistics
|
||||||
{
|
{
|
||||||
|
@ -168,7 +170,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
extern DebugNotify DEBUG_Notify;
|
extern DebugNotify DEBUG_Notify;
|
||||||
struct armcpu_t;
|
|
||||||
|
|
||||||
//information about a debug event will be stuffed into here by the generator
|
//information about a debug event will be stuffed into here by the generator
|
||||||
struct TDebugEventData
|
struct TDebugEventData
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2010 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,8 +15,9 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
#include "driver.h"
|
#include "driver.h"
|
||||||
|
|
||||||
|
#include "debug.h"
|
||||||
#include "rasterize.h"
|
#include "rasterize.h"
|
||||||
#include "gfx3d.h"
|
#include "gfx3d.h"
|
||||||
#include "texcache.h"
|
#include "texcache.h"
|
||||||
|
@ -44,3 +45,8 @@ BaseDriver::~BaseDriver()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseDriver::USR_InfoMessage(const char *message)
|
||||||
|
{
|
||||||
|
LOG("%s\n", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,8 @@
|
||||||
#ifndef _DRIVER_H_
|
#ifndef _DRIVER_H_
|
||||||
#define _DRIVER_H_
|
#define _DRIVER_H_
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
#include "debug.h"
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "types.h"
|
||||||
#ifdef EXPERIMENTAL_WIFI_COMM
|
|
||||||
#include <pcap.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class VIEW3D_Driver
|
class VIEW3D_Driver
|
||||||
{
|
{
|
||||||
|
@ -40,28 +35,11 @@ public:
|
||||||
BaseDriver();
|
BaseDriver();
|
||||||
~BaseDriver();
|
~BaseDriver();
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_WIFI_COMM
|
|
||||||
virtual bool WIFI_SocketsAvailable() { return true; }
|
|
||||||
virtual bool WIFI_PCapAvailable() { return false; }
|
|
||||||
|
|
||||||
virtual void WIFI_GetUniqueMAC(u8* mac) {}
|
|
||||||
|
|
||||||
virtual bool WIFI_WFCWarning() { return false; }
|
|
||||||
|
|
||||||
virtual int PCAP_findalldevs(pcap_if_t** alldevs, char* errbuf) { return -1; }
|
|
||||||
virtual void PCAP_freealldevs(pcap_if_t* alldevs) {}
|
|
||||||
virtual pcap_t* PCAP_open(const char* source, int snaplen, int flags, int readtimeout, char* errbuf) { return NULL; }
|
|
||||||
virtual void PCAP_close(pcap_t* dev) {}
|
|
||||||
virtual int PCAP_setnonblock(pcap_t* dev, int nonblock, char* errbuf) { return -1; }
|
|
||||||
virtual int PCAP_sendpacket(pcap_t* dev, const u_char* data, int len) { return -1; }
|
|
||||||
virtual int PCAP_dispatch(pcap_t* dev, int num, pcap_handler callback, u_char* userdata) { return -1; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual void AVI_SoundUpdate(void* soundData, int soundLen) {}
|
virtual void AVI_SoundUpdate(void* soundData, int soundLen) {}
|
||||||
virtual bool AVI_IsRecording() { return FALSE; }
|
virtual bool AVI_IsRecording() { return FALSE; }
|
||||||
virtual bool WAV_IsRecording() { return FALSE; }
|
virtual bool WAV_IsRecording() { return FALSE; }
|
||||||
|
|
||||||
virtual void USR_InfoMessage(const char *message) { LOG("%s\n", message); }
|
virtual void USR_InfoMessage(const char *message);
|
||||||
virtual void USR_RefreshScreen() {}
|
virtual void USR_RefreshScreen() {}
|
||||||
virtual void USR_SetDisplayPostpone(int milliseconds, bool drawNextFrame) {} // -1 == indefinitely, 0 == don't pospone, 500 == don't draw for 0.5 seconds
|
virtual void USR_SetDisplayPostpone(int milliseconds, bool drawNextFrame) {} // -1 == indefinitely, 0 == don't pospone, 500 == don't draw for 0.5 seconds
|
||||||
|
|
||||||
|
@ -93,38 +71,5 @@ public:
|
||||||
void VIEW3D_Shutdown();
|
void VIEW3D_Shutdown();
|
||||||
void VIEW3D_Init();
|
void VIEW3D_Init();
|
||||||
};
|
};
|
||||||
extern BaseDriver* driver;
|
|
||||||
|
|
||||||
#ifndef HOST_WINDOWS
|
|
||||||
class UnixDriver : public BaseDriver
|
|
||||||
{
|
|
||||||
#ifdef EXPERIMENTAL_WIFI_COMM
|
|
||||||
virtual bool WIFI_SocketsAvailable() { return true; }
|
|
||||||
virtual bool WIFI_PCapAvailable() { return true; }
|
|
||||||
virtual bool WIFI_WFCWarning() { return false; }
|
|
||||||
|
|
||||||
virtual int PCAP_findalldevs(pcap_if_t** alldevs, char* errbuf) {
|
|
||||||
return pcap_findalldevs(alldevs, errbuf); }
|
|
||||||
|
|
||||||
virtual void PCAP_freealldevs(pcap_if_t* alldevs) {
|
|
||||||
pcap_freealldevs(alldevs); }
|
|
||||||
|
|
||||||
virtual pcap_t* PCAP_open(const char* source, int snaplen, int flags, int readtimeout, char* errbuf) {
|
|
||||||
return pcap_open_live(source, snaplen, flags, readtimeout, errbuf); }
|
|
||||||
|
|
||||||
virtual void PCAP_close(pcap_t* dev) {
|
|
||||||
pcap_close(dev); }
|
|
||||||
|
|
||||||
virtual int PCAP_setnonblock(pcap_t* dev, int nonblock, char* errbuf) {
|
|
||||||
return pcap_setnonblock(dev, nonblock, errbuf); }
|
|
||||||
|
|
||||||
virtual int PCAP_sendpacket(pcap_t* dev, const u_char* data, int len) {
|
|
||||||
return pcap_sendpacket(dev, data, len); }
|
|
||||||
|
|
||||||
virtual int PCAP_dispatch(pcap_t* dev, int num, pcap_handler callback, u_char* userdata) {
|
|
||||||
return pcap_dispatch(dev, num, callback, userdata); }
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif //_DRIVER_H_
|
#endif //_DRIVER_H_
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2013 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,9 +15,10 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "encrypt.h"
|
||||||
#include "armcpu.h"
|
#include "armcpu.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "encrypt.h"
|
#include "registers.h"
|
||||||
|
|
||||||
//TODO - a lot of redundant code (maybe?) with utils/decrypt.cpp
|
//TODO - a lot of redundant code (maybe?) with utils/decrypt.cpp
|
||||||
//we should try unifying all that.
|
//we should try unifying all that.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011-2012 Roger Manuel
|
Copyright (C) 2011-2012 Roger Manuel
|
||||||
Copyright (C) 2013-2014 DeSmuME team
|
Copyright (C) 2013-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,13 +22,14 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "../utils/task.h"
|
#include "../utils/task.h"
|
||||||
|
|
||||||
#ifdef HOST_WINDOWS
|
#ifdef HOST_WINDOWS
|
||||||
typedef unsigned __int32 uint32_t;
|
typedef unsigned __int32 uint32_t;
|
||||||
#include <winsock2.h>
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
typedef CRITICAL_SECTION ThreadLock;
|
typedef CRITICAL_SECTION ThreadLock;
|
||||||
typedef HANDLE ThreadCond;
|
typedef HANDLE ThreadCond;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2011 DeSmuME Team
|
Copyright (C) 2009-2015 DeSmuME Team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,10 +16,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "firmware.h"
|
#include "firmware.h"
|
||||||
|
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "encrypt.h"
|
#include "encrypt.h"
|
||||||
|
#include "wifi.h"
|
||||||
|
|
||||||
#define DFC_ID_CODE "DeSmuME Firmware User Settings"
|
#define DFC_ID_CODE "DeSmuME Firmware User Settings"
|
||||||
#define DFC_ID_SIZE sizeof(DFC_ID_CODE)
|
#define DFC_ID_SIZE sizeof(DFC_ID_CODE)
|
||||||
|
@ -811,7 +813,7 @@ static void fill_user_data_area( struct NDS_fw_config_data *user_settings,u8 *da
|
||||||
}
|
}
|
||||||
|
|
||||||
// creates an firmware flash image, which contains all needed info to initiate a wifi connection
|
// creates an firmware flash image, which contains all needed info to initiate a wifi connection
|
||||||
int NDS_CreateDummyFirmware( struct NDS_fw_config_data *user_settings)
|
int NDS_CreateDummyFirmware(NDS_fw_config_data *user_settings)
|
||||||
{
|
{
|
||||||
//Create the firmware header
|
//Create the firmware header
|
||||||
|
|
||||||
|
@ -895,18 +897,18 @@ int NDS_CreateDummyFirmware( struct NDS_fw_config_data *user_settings)
|
||||||
(*(u16*)(MMU.fw.data + 0x2A)) = calc_CRC16(0, (MMU.fw.data + 0x2C), 0x138);
|
(*(u16*)(MMU.fw.data + 0x2A)) = calc_CRC16(0, (MMU.fw.data + 0x2C), 0x138);
|
||||||
|
|
||||||
if (&CommonSettings.fw_config != user_settings)
|
if (&CommonSettings.fw_config != user_settings)
|
||||||
memcpy(&CommonSettings.fw_config, user_settings, sizeof(struct NDS_fw_config_data));
|
memcpy(&CommonSettings.fw_config, user_settings, sizeof(NDS_fw_config_data));
|
||||||
|
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NDS_FillDefaultFirmwareConfigData( struct NDS_fw_config_data *fw_config) {
|
void NDS_FillDefaultFirmwareConfigData(NDS_fw_config_data *fw_config) {
|
||||||
const char *default_nickname = "DeSmuME";
|
const char *default_nickname = "DeSmuME";
|
||||||
const char *default_message = "DeSmuME makes you happy!";
|
const char *default_message = "DeSmuME makes you happy!";
|
||||||
int i;
|
int i;
|
||||||
int str_length;
|
int str_length;
|
||||||
|
|
||||||
memset( fw_config, 0, sizeof( struct NDS_fw_config_data));
|
memset( fw_config, 0, sizeof(NDS_fw_config_data));
|
||||||
fw_config->ds_type = NDS_CONSOLE_TYPE_FAT;
|
fw_config->ds_type = NDS_CONSOLE_TYPE_FAT;
|
||||||
|
|
||||||
fw_config->fav_colour = 7;
|
fw_config->fav_colour = 7;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2013 DeSmuME Team
|
Copyright (C) 2009-2015 DeSmuME Team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,7 +17,9 @@
|
||||||
|
|
||||||
#ifndef _FIRMWARE_H_
|
#ifndef _FIRMWARE_H_
|
||||||
#define _FIRMWARE_H_
|
#define _FIRMWARE_H_
|
||||||
#include "common.h"
|
|
||||||
|
#include <string>
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
#define NDS_FW_SIZE_V1 (256 * 1024) /* size of fw memory on nds v1 */
|
#define NDS_FW_SIZE_V1 (256 * 1024) /* size of fw memory on nds v1 */
|
||||||
#define NDS_FW_SIZE_V2 (512 * 1024) /* size of fw memory on nds v2 */
|
#define NDS_FW_SIZE_V2 (512 * 1024) /* size of fw memory on nds v2 */
|
||||||
|
@ -28,6 +30,8 @@
|
||||||
//extension of the firmware user settings file
|
//extension of the firmware user settings file
|
||||||
#define FW_CONFIG_FILE_EXT "dfc"
|
#define FW_CONFIG_FILE_EXT "dfc"
|
||||||
|
|
||||||
|
struct NDS_fw_config_data;
|
||||||
|
|
||||||
class CFIRMWARE
|
class CFIRMWARE
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -86,8 +90,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
int copy_firmware_user_data( u8 *dest_buffer, const u8 *fw_data);
|
int copy_firmware_user_data( u8 *dest_buffer, const u8 *fw_data);
|
||||||
int NDS_CreateDummyFirmware( struct NDS_fw_config_data *user_settings);
|
int NDS_CreateDummyFirmware(NDS_fw_config_data *user_settings);
|
||||||
void NDS_FillDefaultFirmwareConfigData( struct NDS_fw_config_data *fw_config);
|
void NDS_FillDefaultFirmwareConfigData(NDS_fw_config_data *fw_config);
|
||||||
void NDS_PatchFirmwareMAC();
|
void NDS_PatchFirmwareMAC();
|
||||||
|
|
||||||
struct fw_memory_chip
|
struct fw_memory_chip
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 Ben Jaques
|
Copyright (C) 2006 Ben Jaques
|
||||||
Copyright (C) 2008-2009 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,7 +22,8 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
typedef void *gdbstub_handle_t;
|
typedef void *gdbstub_handle_t;
|
||||||
extern const armcpu_memory_iface gdb_memory_iface;
|
struct armcpu_t;
|
||||||
|
struct armcpu_memory_iface;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The function interface
|
* The function interface
|
||||||
|
|
|
@ -22,34 +22,18 @@
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "gdbstub_internal.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
//#include <stdint.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "../gdbstub.h"
|
||||||
#include "NDSSystem.h"
|
#include "../types.h"
|
||||||
|
#include "../NDSSystem.h"
|
||||||
#ifdef WIN32
|
#include "../armcpu.h"
|
||||||
#include <winsock2.h>
|
#include "../MMU.h"
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netinet/tcp.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "armcpu.h"
|
|
||||||
|
|
||||||
#define uint32_t u32
|
|
||||||
#define uint16_t u16
|
|
||||||
#define uint8_t u8
|
|
||||||
|
|
||||||
#include "gdbstub.h"
|
|
||||||
#include "gdbstub_internal.h"
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define UNUSED_PARM( parm) parm __attribute__((unused))
|
#define UNUSED_PARM( parm) parm __attribute__((unused))
|
||||||
|
@ -638,7 +622,7 @@ processPacket_gdb( SOCKET_TYPE sock, const uint8_t *packet,
|
||||||
if ( *rx_ptr++ == ',') {
|
if ( *rx_ptr++ == ',') {
|
||||||
if ( hexToInt( &rx_ptr, &length)) {
|
if ( hexToInt( &rx_ptr, &length)) {
|
||||||
//DEBUG_LOG("mem read from %08x (%d)\n", addr, length);
|
//DEBUG_LOG("mem read from %08x (%d)\n", addr, length);
|
||||||
if ( !mem2hex( &stub->direct_memio, addr, out_ptr, length)) {
|
if ( !mem2hex( stub->direct_memio, addr, out_ptr, length)) {
|
||||||
strcpy ( (char *)out_ptr, "E03");
|
strcpy ( (char *)out_ptr, "E03");
|
||||||
send_size = 3;
|
send_size = 3;
|
||||||
}
|
}
|
||||||
|
@ -674,7 +658,7 @@ processPacket_gdb( SOCKET_TYPE sock, const uint8_t *packet,
|
||||||
for ( i = 0; i < length; i++) {
|
for ( i = 0; i < length; i++) {
|
||||||
rx_ptr = hex2mem( rx_ptr, &write_byte, 1);
|
rx_ptr = hex2mem( rx_ptr, &write_byte, 1);
|
||||||
|
|
||||||
stub->direct_memio.write8( stub->direct_memio.data,
|
stub->direct_memio->write8( stub->direct_memio->data,
|
||||||
addr++, write_byte);
|
addr++, write_byte);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1397,7 +1381,21 @@ gdb_write32( void *data, uint32_t adr, uint32_t val) {
|
||||||
STOP_AWATCHPOINT);
|
STOP_AWATCHPOINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GDB memory interface for the ARM CPUs
|
||||||
|
static const armcpu_memory_iface gdb_memory_iface = {
|
||||||
|
gdb_prefetch32,
|
||||||
|
gdb_prefetch16,
|
||||||
|
|
||||||
|
gdb_read8,
|
||||||
|
gdb_read16,
|
||||||
|
gdb_read32,
|
||||||
|
|
||||||
|
gdb_write8,
|
||||||
|
gdb_write16,
|
||||||
|
gdb_write32,
|
||||||
|
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1453,20 +1451,19 @@ createStub_gdb( uint16_t port,
|
||||||
return stub;
|
return stub;
|
||||||
}
|
}
|
||||||
|
|
||||||
stub = (gdb_stub_state*)malloc( sizeof (struct gdb_stub_state));
|
stub = new gdb_stub_state;
|
||||||
if ( stub == NULL) {
|
|
||||||
return stub;
|
|
||||||
}
|
|
||||||
|
|
||||||
stub->arm_cpu_object = theCPU;
|
stub->arm_cpu_object = theCPU;
|
||||||
stub->active = 0;
|
stub->active = 0;
|
||||||
|
|
||||||
/* keep the memory interfaces */
|
/* keep the memory interfaces */
|
||||||
stub->cpu_memio = theCPU->GetBaseMemoryInterface();
|
stub->cpu_memio = theCPU->GetBaseMemoryInterface();
|
||||||
stub->direct_memio = *direct_memio;
|
|
||||||
|
|
||||||
stub->gdb_memio = gdb_memory_iface;
|
stub->direct_memio = new armcpu_memory_iface;
|
||||||
stub->gdb_memio.data = stub;
|
*(stub->direct_memio) = *direct_memio;
|
||||||
|
|
||||||
|
stub->gdb_memio = new armcpu_memory_iface;
|
||||||
|
*(stub->gdb_memio) = gdb_memory_iface;
|
||||||
|
stub->gdb_memio->data = stub;
|
||||||
|
|
||||||
stub->cpu_ctrl = theCPU->GetControlInterface();
|
stub->cpu_ctrl = theCPU->GetControlInterface();
|
||||||
|
|
||||||
|
@ -1570,14 +1567,14 @@ createStub_gdb( uint16_t port,
|
||||||
|
|
||||||
if ( stub->thread == NULL) {
|
if ( stub->thread == NULL) {
|
||||||
LOG_ERROR("Failed to create listener thread\n");
|
LOG_ERROR("Failed to create listener thread\n");
|
||||||
free( stub);
|
delete stub;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DEBUG_LOG("Created GDB stub on port %d\n", port);
|
DEBUG_LOG("Created GDB stub on port %d\n", port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
free( stub);
|
delete stub;
|
||||||
}
|
}
|
||||||
|
|
||||||
return stub;
|
return stub;
|
||||||
|
@ -1601,7 +1598,9 @@ destroyStub_gdb( gdbstub_handle_t instance) {
|
||||||
theCPU->ResetMemoryInterfaceToBase();
|
theCPU->ResetMemoryInterfaceToBase();
|
||||||
|
|
||||||
DEBUG_LOG("Destroyed GDB stub on port %d\n", stub->port_num);
|
DEBUG_LOG("Destroyed GDB stub on port %d\n", stub->port_num);
|
||||||
free( stub);
|
delete stub->direct_memio;
|
||||||
|
delete stub->gdb_memio;
|
||||||
|
delete stub;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1611,26 +1610,10 @@ activateStub_gdb( gdbstub_handle_t instance) {
|
||||||
struct gdb_stub_state *stub = (struct gdb_stub_state *)instance;
|
struct gdb_stub_state *stub = (struct gdb_stub_state *)instance;
|
||||||
armcpu_t *theCPU = (armcpu_t *)stub->arm_cpu_object;
|
armcpu_t *theCPU = (armcpu_t *)stub->arm_cpu_object;
|
||||||
|
|
||||||
theCPU->SetCurrentMemoryInterface(&stub->gdb_memio);
|
theCPU->SetCurrentMemoryInterface(stub->gdb_memio);
|
||||||
|
|
||||||
/* stall the cpu */
|
/* stall the cpu */
|
||||||
stub->cpu_ctrl->stall( stub->cpu_ctrl->data);
|
stub->cpu_ctrl->stall( stub->cpu_ctrl->data);
|
||||||
|
|
||||||
stub->active = 1;
|
stub->active = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GDB memory interface for the ARM CPUs
|
|
||||||
const armcpu_memory_iface gdb_memory_iface = {
|
|
||||||
gdb_prefetch32,
|
|
||||||
gdb_prefetch16,
|
|
||||||
|
|
||||||
gdb_read8,
|
|
||||||
gdb_read16,
|
|
||||||
gdb_read32,
|
|
||||||
|
|
||||||
gdb_write8,
|
|
||||||
gdb_write16,
|
|
||||||
gdb_write32,
|
|
||||||
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
|
@ -26,8 +26,22 @@
|
||||||
#define _GDBSTUB_INTERNAL_H_ 1
|
#define _GDBSTUB_INTERNAL_H_ 1
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
typedef __int32 int32_t;
|
||||||
|
typedef unsigned __int32 uint32_t;
|
||||||
|
typedef __int16 int16_t;
|
||||||
|
typedef unsigned __int16 uint16_t;
|
||||||
|
typedef __int8 int8_t;
|
||||||
|
typedef unsigned __int8 uint8_t;
|
||||||
|
|
||||||
|
#include <winsock2.h>
|
||||||
#define SOCKET_TYPE SOCKET
|
#define SOCKET_TYPE SOCKET
|
||||||
#else
|
#else
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/tcp.h>
|
||||||
#define SOCKET_TYPE int
|
#define SOCKET_TYPE int
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -42,6 +56,8 @@ enum stop_type {
|
||||||
STOP_AWATCHPOINT
|
STOP_AWATCHPOINT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct armcpu_ctrl_iface;
|
||||||
|
struct armcpu_memory_iface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The structure describing a breakpoint.
|
* The structure describing a breakpoint.
|
||||||
|
@ -99,10 +115,10 @@ struct gdb_stub_state {
|
||||||
armcpu_memory_iface *cpu_memio;
|
armcpu_memory_iface *cpu_memio;
|
||||||
|
|
||||||
/** the direct interface to the memory system */
|
/** the direct interface to the memory system */
|
||||||
armcpu_memory_iface direct_memio;
|
armcpu_memory_iface *direct_memio;
|
||||||
|
|
||||||
/** GDB stub's memory interface passed to the CPU */
|
/** GDB stub's memory interface passed to the CPU */
|
||||||
armcpu_memory_iface gdb_memio;
|
armcpu_memory_iface *gdb_memio;
|
||||||
|
|
||||||
/** the list of active instruction breakpoints */
|
/** the list of active instruction breakpoints */
|
||||||
struct breakpoint_gdb *instr_breakpoints;
|
struct breakpoint_gdb *instr_breakpoints;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -28,13 +28,18 @@
|
||||||
//if they do, then we need to copy them out in doFlush!!!
|
//if they do, then we need to copy them out in doFlush!!!
|
||||||
//---------------
|
//---------------
|
||||||
|
|
||||||
#include <algorithm>
|
#include "gfx3d.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <queue>
|
||||||
|
|
||||||
#include "armcpu.h"
|
#include "armcpu.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "gfx3d.h"
|
#include "driver.h"
|
||||||
|
#include "emufile.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
|
@ -46,7 +51,6 @@
|
||||||
#include "readwrite.h"
|
#include "readwrite.h"
|
||||||
#include "FIFO.h"
|
#include "FIFO.h"
|
||||||
#include "movie.h" //only for currframecounter which really ought to be moved into the core emu....
|
#include "movie.h" //only for currframecounter which really ought to be moved into the core emu....
|
||||||
#include <queue>
|
|
||||||
|
|
||||||
//#define _SHOW_VTX_COUNTERS // show polygon/vertex counters on screen
|
//#define _SHOW_VTX_COUNTERS // show polygon/vertex counters on screen
|
||||||
#ifdef _SHOW_VTX_COUNTERS
|
#ifdef _SHOW_VTX_COUNTERS
|
||||||
|
@ -459,6 +463,44 @@ static void makeTables() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define OSWRITE(x) os->fwrite((char*)&(x),sizeof((x)));
|
||||||
|
#define OSREAD(x) is->fread((char*)&(x),sizeof((x)));
|
||||||
|
|
||||||
|
void POLY::save(EMUFILE* os)
|
||||||
|
{
|
||||||
|
OSWRITE(type);
|
||||||
|
OSWRITE(vertIndexes[0]); OSWRITE(vertIndexes[1]); OSWRITE(vertIndexes[2]); OSWRITE(vertIndexes[3]);
|
||||||
|
OSWRITE(polyAttr); OSWRITE(texParam); OSWRITE(texPalette);
|
||||||
|
OSWRITE(viewport);
|
||||||
|
OSWRITE(miny);
|
||||||
|
OSWRITE(maxy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void POLY::load(EMUFILE* is)
|
||||||
|
{
|
||||||
|
OSREAD(type);
|
||||||
|
OSREAD(vertIndexes[0]); OSREAD(vertIndexes[1]); OSREAD(vertIndexes[2]); OSREAD(vertIndexes[3]);
|
||||||
|
OSREAD(polyAttr); OSREAD(texParam); OSREAD(texPalette);
|
||||||
|
OSREAD(viewport);
|
||||||
|
OSREAD(miny);
|
||||||
|
OSREAD(maxy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void VERT::save(EMUFILE* os)
|
||||||
|
{
|
||||||
|
OSWRITE(x); OSWRITE(y); OSWRITE(z); OSWRITE(w);
|
||||||
|
OSWRITE(u); OSWRITE(v);
|
||||||
|
OSWRITE(color[0]); OSWRITE(color[1]); OSWRITE(color[2]);
|
||||||
|
OSWRITE(fcolor[0]); OSWRITE(fcolor[1]); OSWRITE(fcolor[2]);
|
||||||
|
}
|
||||||
|
void VERT::load(EMUFILE* is)
|
||||||
|
{
|
||||||
|
OSREAD(x); OSREAD(y); OSREAD(z); OSREAD(w);
|
||||||
|
OSREAD(u); OSREAD(v);
|
||||||
|
OSREAD(color[0]); OSREAD(color[1]); OSREAD(color[2]);
|
||||||
|
OSREAD(fcolor[0]); OSREAD(fcolor[1]); OSREAD(fcolor[2]);
|
||||||
|
}
|
||||||
|
|
||||||
void gfx3d_init()
|
void gfx3d_init()
|
||||||
{
|
{
|
||||||
gxf_hardware.reset();
|
gxf_hardware.reset();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2008-2012 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,9 +22,10 @@
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <istream>
|
#include <istream>
|
||||||
#include "types.h"
|
|
||||||
#include "emufile.h"
|
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
// Pixel dimensions of the NDS 3D framebuffer
|
// Pixel dimensions of the NDS 3D framebuffer
|
||||||
#define GFX3D_FRAMEBUFFER_WIDTH 256
|
#define GFX3D_FRAMEBUFFER_WIDTH 256
|
||||||
|
@ -232,9 +233,6 @@ enum
|
||||||
void gfx3d_init();
|
void gfx3d_init();
|
||||||
void gfx3d_reset();
|
void gfx3d_reset();
|
||||||
|
|
||||||
#define OSWRITE(x) os->fwrite((char*)&(x),sizeof((x)));
|
|
||||||
#define OSREAD(x) is->fread((char*)&(x),sizeof((x)));
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
u8 enableLightFlags;
|
u8 enableLightFlags;
|
||||||
|
@ -497,25 +495,8 @@ struct POLY {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void save(EMUFILE* os)
|
void save(EMUFILE* os);
|
||||||
{
|
void load(EMUFILE* is);
|
||||||
OSWRITE(type);
|
|
||||||
OSWRITE(vertIndexes[0]); OSWRITE(vertIndexes[1]); OSWRITE(vertIndexes[2]); OSWRITE(vertIndexes[3]);
|
|
||||||
OSWRITE(polyAttr); OSWRITE(texParam); OSWRITE(texPalette);
|
|
||||||
OSWRITE(viewport);
|
|
||||||
OSWRITE(miny);
|
|
||||||
OSWRITE(maxy);
|
|
||||||
}
|
|
||||||
|
|
||||||
void load(EMUFILE* is)
|
|
||||||
{
|
|
||||||
OSREAD(type);
|
|
||||||
OSREAD(vertIndexes[0]); OSREAD(vertIndexes[1]); OSREAD(vertIndexes[2]); OSREAD(vertIndexes[3]);
|
|
||||||
OSREAD(polyAttr); OSREAD(texParam); OSREAD(texPalette);
|
|
||||||
OSREAD(viewport);
|
|
||||||
OSREAD(miny);
|
|
||||||
OSREAD(maxy);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define POLYLIST_SIZE 100000
|
#define POLYLIST_SIZE 100000
|
||||||
|
@ -582,20 +563,8 @@ struct VERT {
|
||||||
fcolor[1] = color[1];
|
fcolor[1] = color[1];
|
||||||
fcolor[2] = color[2];
|
fcolor[2] = color[2];
|
||||||
}
|
}
|
||||||
void save(EMUFILE* os)
|
void save(EMUFILE* os);
|
||||||
{
|
void load(EMUFILE* is);
|
||||||
OSWRITE(x); OSWRITE(y); OSWRITE(z); OSWRITE(w);
|
|
||||||
OSWRITE(u); OSWRITE(v);
|
|
||||||
OSWRITE(color[0]); OSWRITE(color[1]); OSWRITE(color[2]);
|
|
||||||
OSWRITE(fcolor[0]); OSWRITE(fcolor[1]); OSWRITE(fcolor[2]);
|
|
||||||
}
|
|
||||||
void load(EMUFILE* is)
|
|
||||||
{
|
|
||||||
OSREAD(x); OSREAD(y); OSREAD(z); OSREAD(w);
|
|
||||||
OSREAD(u); OSREAD(v);
|
|
||||||
OSREAD(color[0]); OSREAD(color[1]); OSREAD(color[2]);
|
|
||||||
OSREAD(fcolor[0]); OSREAD(fcolor[1]); OSREAD(fcolor[2]);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define VERTLIST_SIZE 400000
|
#define VERTLIST_SIZE 400000
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#ifndef __DTOOL_H__
|
#ifndef __DTOOL_H__
|
||||||
#define __DTOOL_H__
|
#define __DTOOL_H__
|
||||||
|
|
||||||
#include "../types.h"
|
|
||||||
#include "../registers.h"
|
|
||||||
|
|
||||||
typedef void (*dTool_openFn)(int id);
|
typedef void (*dTool_openFn)(int id);
|
||||||
typedef void (*dTool_updateFn)();
|
typedef void (*dTool_updateFn)();
|
||||||
typedef void (*dTool_closeFn)();
|
typedef void (*dTool_closeFn)();
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* dToolsList.cpp
|
/* dToolsList.cpp
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Thoduv
|
* Copyright (C) 2006 Thoduv
|
||||||
|
* Copyright (C) 2006-2015 DeSmuME Team
|
||||||
*
|
*
|
||||||
* This file is part of DeSmuME
|
* This file is part of DeSmuME
|
||||||
*
|
*
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dTool.h"
|
#include "dTool.h"
|
||||||
|
#include "../types.h"
|
||||||
#include "tools/ioregsView.h"
|
#include "tools/ioregsView.h"
|
||||||
|
|
||||||
dTool_t *dTools_list[] =
|
dTool_t *dTools_list[] =
|
||||||
|
|
|
@ -19,13 +19,13 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
#include "NDSSystem.h"
|
|
||||||
#include "SPU.h"
|
|
||||||
#include "sndsdl.h"
|
|
||||||
#include "ctrlssdl.h"
|
|
||||||
#include "desmume.h"
|
#include "desmume.h"
|
||||||
#include "movie.h"
|
|
||||||
|
#include "../NDSSystem.h"
|
||||||
|
#include "../SPU.h"
|
||||||
|
#include "../sndsdl.h"
|
||||||
|
#include "../movie.h"
|
||||||
|
|
||||||
volatile bool execute = false;
|
volatile bool execute = false;
|
||||||
BOOL click = FALSE;
|
BOOL click = FALSE;
|
||||||
|
|
|
@ -34,8 +34,10 @@
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "firmware.h"
|
#include "firmware.h"
|
||||||
#include "armcpu.h"
|
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
|
#include "driver.h"
|
||||||
|
#include "GPU.h"
|
||||||
|
#include "SPU.h"
|
||||||
#include "sndsdl.h"
|
#include "sndsdl.h"
|
||||||
#include "ctrlssdl.h"
|
#include "ctrlssdl.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
|
@ -63,6 +65,7 @@
|
||||||
#include "filter/videofilter.h"
|
#include "filter/videofilter.h"
|
||||||
|
|
||||||
#ifdef GDB_STUB
|
#ifdef GDB_STUB
|
||||||
|
#include "armcpu.h"
|
||||||
#include "gdbstub.h"
|
#include "gdbstub.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2336,7 +2339,7 @@ static inline void _updateDTools()
|
||||||
|
|
||||||
/////////////////////////////// MAIN EMULATOR LOOP ///////////////////////////////
|
/////////////////////////////// MAIN EMULATOR LOOP ///////////////////////////////
|
||||||
|
|
||||||
class GtkDriver : public UnixDriver
|
class GtkDriver : public BaseDriver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void EMU_DebugIdleUpdate()
|
virtual void EMU_DebugIdleUpdate()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* ioregsView.cpp - this file is part of DeSmuME
|
/* ioregsView.cpp - this file is part of DeSmuME
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Thoduv
|
* Copyright (C) 2006 Thoduv
|
||||||
* Copyright (C) 2006,2007 DeSmuME Team
|
* Copyright (C) 2006-2015 DeSmuME Team
|
||||||
*
|
*
|
||||||
* This file is free software; you can redistribute it and/or modify
|
* This file 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
|
||||||
|
@ -23,7 +23,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../dTool.h"
|
#include "../dTool.h"
|
||||||
|
|
||||||
#include "../MMU.h"
|
#include "../../MMU.h"
|
||||||
|
#include "../../registers.h"
|
||||||
|
|
||||||
#undef GPOINTER_TO_INT
|
#undef GPOINTER_TO_INT
|
||||||
#define GPOINTER_TO_INT(p) ((gint) (glong) (p))
|
#define GPOINTER_TO_INT(p) ((gint) (glong) (p))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright (C) 2006 yopyop
|
/* Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2012 DeSmuME team
|
Copyright (C) 2012-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,6 +18,8 @@
|
||||||
#ifndef _INSTRUCIONS_H_
|
#ifndef _INSTRUCIONS_H_
|
||||||
#define _INSTRUCIONS_H_
|
#define _INSTRUCIONS_H_
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
typedef u32 (FASTCALL* OpFunc)(const u32 i);
|
typedef u32 (FASTCALL* OpFunc)(const u32 i);
|
||||||
extern const OpFunc arm_instructions_set[2][4096];
|
extern const OpFunc arm_instructions_set[2][4096];
|
||||||
extern const char* arm_instruction_names[4096];
|
extern const char* arm_instruction_names[4096];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2012 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,31 +15,44 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
#include "lua-engine.h"
|
#include "lua-engine.h"
|
||||||
#include "movie.h"
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
#include <direct.h>
|
||||||
|
|
||||||
|
typedef HMENU PlatformMenu; // hMenu
|
||||||
|
#define MAX_MENU_COUNT (IDC_LUAMENU_RESERVE_END - IDC_LUAMENU_RESERVE_START + 1)
|
||||||
|
|
||||||
|
#include "windows/main.h"
|
||||||
|
#include "windows/video.h"
|
||||||
|
#include "windows/resource.h"
|
||||||
|
#else
|
||||||
|
// TODO: define appropriate types for menu
|
||||||
|
typedef void* PlatformMenu;
|
||||||
|
#define MAX_MENU_COUNT 0
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "armcpu.h"
|
||||||
|
#include "movie.h"
|
||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
|
#include "driver.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "movie.h"
|
#include "movie.h"
|
||||||
|
#include "MMU.h"
|
||||||
|
#include "GPU.h"
|
||||||
#include "GPU_osd.h"
|
#include "GPU_osd.h"
|
||||||
|
#include "SPU.h"
|
||||||
#include "saves.h"
|
#include "saves.h"
|
||||||
#include "emufile.h"
|
#include "emufile.h"
|
||||||
#if defined(WIN32)
|
|
||||||
#include <windows.h>
|
|
||||||
#include "main.h"
|
|
||||||
#include "video.h"
|
|
||||||
#include "resource.h"
|
|
||||||
#endif
|
|
||||||
#ifdef WIN32
|
|
||||||
#include <direct.h>
|
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -3523,7 +3536,7 @@ static PlatformMenu AddSubMenu(PlatformMenu topMenu, PlatformMenu menu, const ch
|
||||||
}
|
}
|
||||||
|
|
||||||
// add new submenu
|
// add new submenu
|
||||||
UINT subMenuId;
|
PlatformMenuItem subMenuId;
|
||||||
if (!SearchFreeMenuItem(topMenu, subMenuId))
|
if (!SearchFreeMenuItem(topMenu, subMenuId))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -3567,7 +3580,7 @@ bool AddMenuEntries(PlatformMenu topMenu, PlatformMenu menu)
|
||||||
lua_rawgeti(L, -1, index);
|
lua_rawgeti(L, -1, index);
|
||||||
if (lua_isnil(L, -1))
|
if (lua_isnil(L, -1))
|
||||||
{
|
{
|
||||||
UINT menuItem;
|
PlatformMenuItem menuItem;
|
||||||
if (!SearchFreeMenuItem(topMenu, menuItem))
|
if (!SearchFreeMenuItem(topMenu, menuItem))
|
||||||
{
|
{
|
||||||
luaL_error(L, "too many menu items");
|
luaL_error(L, "too many menu items");
|
||||||
|
@ -3597,7 +3610,7 @@ bool AddMenuEntries(PlatformMenu topMenu, PlatformMenu menu)
|
||||||
lua_rawgeti(L, -1, 2);
|
lua_rawgeti(L, -1, 2);
|
||||||
if (lua_isfunction(L, -1))
|
if (lua_isfunction(L, -1))
|
||||||
{
|
{
|
||||||
UINT menuItem;
|
PlatformMenuItem menuItem;
|
||||||
if (!SearchFreeMenuItem(topMenu, menuItem))
|
if (!SearchFreeMenuItem(topMenu, menuItem))
|
||||||
{
|
{
|
||||||
luaL_error(L, "too many menu items");
|
luaL_error(L, "too many menu items");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2010 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -20,12 +20,6 @@
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#if defined(WIN32)
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include "resource.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void OpenLuaContext(int uid, void(*print)(int uid, const char* str) = 0, void(*onstart)(int uid) = 0, void(*onstop)(int uid, bool statusOK) = 0);
|
void OpenLuaContext(int uid, void(*print)(int uid, const char* str) = 0, void(*onstart)(int uid) = 0, void(*onstop)(int uid, bool statusOK) = 0);
|
||||||
void RunLuaScriptFile(int uid, const char* filename);
|
void RunLuaScriptFile(int uid, const char* filename);
|
||||||
void StopLuaScript(int uid);
|
void StopLuaScript(int uid);
|
||||||
|
@ -110,16 +104,7 @@ private:
|
||||||
void CallRegisteredLuaSaveFunctions(int savestateNumber, LuaSaveData& saveData);
|
void CallRegisteredLuaSaveFunctions(int savestateNumber, LuaSaveData& saveData);
|
||||||
void CallRegisteredLuaLoadFunctions(int savestateNumber, const LuaSaveData& saveData);
|
void CallRegisteredLuaLoadFunctions(int savestateNumber, const LuaSaveData& saveData);
|
||||||
|
|
||||||
#if defined(WIN32)
|
typedef size_t PlatformMenuItem;
|
||||||
typedef HMENU PlatformMenu; // hMenu
|
|
||||||
typedef UINT PlatformMenuItem; // menuId
|
|
||||||
#define MAX_MENU_COUNT (IDC_LUAMENU_RESERVE_END - IDC_LUAMENU_RESERVE_START + 1)
|
|
||||||
#else
|
|
||||||
// TODO: define appropriate types for menu
|
|
||||||
typedef void* PlatformMenu;
|
|
||||||
typedef u32 PlatformMenuItem;
|
|
||||||
#define MAX_MENU_COUNT 0
|
|
||||||
#endif
|
|
||||||
void CallRegisteredLuaMenuHandlers(PlatformMenuItem menuItem);
|
void CallRegisteredLuaMenuHandlers(PlatformMenuItem menuItem);
|
||||||
|
|
||||||
void StopAllLuaScripts();
|
void StopAllLuaScripts();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 thoduv
|
Copyright (C) 2006 thoduv
|
||||||
Copyright (C) 2006-2007 Theo Berkau
|
Copyright (C) 2006-2007 Theo Berkau
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,13 +17,16 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "mc.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "common.h"
|
||||||
|
#include "armcpu.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "mc.h"
|
|
||||||
#include "movie.h"
|
#include "movie.h"
|
||||||
|
#include "MMU.h"
|
||||||
#include "readwrite.h"
|
#include "readwrite.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
@ -526,6 +529,16 @@ void BackupDevice::writeLong(u32 val)
|
||||||
fpMC->write32le(val);
|
fpMC->write32le(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BackupDevice::seek(u32 pos)
|
||||||
|
{
|
||||||
|
fpMC->fseek(pos, SEEK_SET);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BackupDevice::flushBackup()
|
||||||
|
{
|
||||||
|
fpMC->fflush();
|
||||||
|
}
|
||||||
|
|
||||||
bool BackupDevice::saveBuffer(u8 *data, u32 size, bool _rewind, bool _truncate)
|
bool BackupDevice::saveBuffer(u8 *data, u32 size, bool _rewind, bool _truncate)
|
||||||
{
|
{
|
||||||
if (_rewind)
|
if (_rewind)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 thoduv
|
Copyright (C) 2006 thoduv
|
||||||
Copyright (C) 2006 Theo Berkau
|
Copyright (C) 2006 Theo Berkau
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -23,10 +23,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "emufile.h"
|
|
||||||
#include "common.h"
|
|
||||||
#include "utils/tinyxml/tinyxml.h"
|
|
||||||
|
|
||||||
#define MAX_SAVE_TYPES 13
|
#define MAX_SAVE_TYPES 13
|
||||||
#define MC_TYPE_AUTODETECT 0x0
|
#define MC_TYPE_AUTODETECT 0x0
|
||||||
|
@ -50,6 +48,9 @@
|
||||||
#define MC_SIZE_256MBITS 0x2000000
|
#define MC_SIZE_256MBITS 0x2000000
|
||||||
#define MC_SIZE_512MBITS 0x4000000
|
#define MC_SIZE_512MBITS 0x4000000
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
class EMUFILE_FILE;
|
||||||
|
|
||||||
//This "backup device" represents a typical retail NDS save memory accessible via AUXSPI.
|
//This "backup device" represents a typical retail NDS save memory accessible via AUXSPI.
|
||||||
//It is managed as a core emulator service for historical reasons which are bad,
|
//It is managed as a core emulator service for historical reasons which are bad,
|
||||||
//and possible infrastructural simplification reasons which are good.
|
//and possible infrastructural simplification reasons which are good.
|
||||||
|
@ -84,9 +85,9 @@ public:
|
||||||
void writeWord(u16 val);
|
void writeWord(u16 val);
|
||||||
void writeLong(u32 val);
|
void writeLong(u32 val);
|
||||||
|
|
||||||
void seek(u32 pos) { fpMC->fseek(pos, SEEK_SET); }
|
void seek(u32 pos);
|
||||||
|
|
||||||
void flushBackup() { fpMC->fflush(); }
|
void flushBackup();
|
||||||
|
|
||||||
u8 searchFileSaveType(u32 size);
|
u8 searchFileSaveType(u32 size);
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#include "Global.h"
|
//#include "Global.h"
|
||||||
#include "types.h"
|
|
||||||
#include "SndOut.h"
|
#include "SndOut.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
//----------------
|
//----------------
|
||||||
int SndOutLatencyMS = 160;
|
int SndOutLatencyMS = 160;
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
struct StereoOut16;
|
struct StereoOut16;
|
||||||
struct StereoOut32;
|
struct StereoOut32;
|
||||||
struct StereoOutFloat;
|
struct StereoOutFloat;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
//#include "Global.h"
|
//#include "Global.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "SndOut.h"
|
#include "SndOut.h"
|
||||||
//#include "SoundTouch/WavFile.h"
|
//#include "SoundTouch/WavFile.h"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 2009 DeSmuME team
|
/* Copyright 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is part of DeSmuME
|
This file is part of DeSmuME
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
#include "metaspu.h"
|
#include "metaspu.h"
|
||||||
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 2009-2010 DeSmuME team
|
/* Copyright 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -26,6 +26,8 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
static FORCEINLINE void Clampify( T& src, T min, T max )
|
static FORCEINLINE void Clampify( T& src, T min, T max )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2011 DeSmuME Team
|
Copyright (C) 2009-2015 DeSmuME Team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,10 +18,10 @@
|
||||||
#ifndef MIC_H
|
#ifndef MIC_H
|
||||||
#define MIC_H
|
#define MIC_H
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include "emufile.h"
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
static char MicSampleName[256];
|
static char MicSampleName[256];
|
||||||
bool LoadSample(const char *name);
|
bool LoadSample(const char *name);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2008-2014 DeSmuME team
|
Copyright 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,18 +16,23 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include "movie.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "utils/guid.h"
|
#include "utils/guid.h"
|
||||||
#include "utils/xstring.h"
|
#include "utils/xstring.h"
|
||||||
#include "utils/datetime.h"
|
#include "utils/datetime.h"
|
||||||
#include "utils/ConvertUTF.h"
|
#include "utils/ConvertUTF.h"
|
||||||
#include "movie.h"
|
|
||||||
|
#include "MMU.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "readwrite.h"
|
#include "readwrite.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "driver.h"
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "mic.h"
|
#include "mic.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2008-2014 DeSmuME team
|
Copyright 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -23,13 +23,13 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "emufile.h"
|
|
||||||
|
|
||||||
#include "utils/datetime.h"
|
#include "utils/datetime.h"
|
||||||
#include "utils/guid.h"
|
#include "utils/guid.h"
|
||||||
#include "utils/md5.h"
|
#include "utils/md5.h"
|
||||||
|
|
||||||
struct UserInput;
|
struct UserInput;
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2013 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,19 +16,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "types.h"
|
||||||
#ifdef HOST_WINDOWS
|
|
||||||
#define mkdir _mkdir
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HOST_WINDOWS)
|
#if defined(HOST_WINDOWS)
|
||||||
#include <winsock2.h>
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include "common.h"
|
#define mkdir _mkdir
|
||||||
|
|
||||||
#ifndef DESMUME_QT
|
#ifndef DESMUME_QT
|
||||||
#include "winutil.h"
|
#include "windows/winutil.h"
|
||||||
#include "resource.h"
|
#include "windows/resource.h"
|
||||||
#endif
|
#endif
|
||||||
#elif !defined(DESMUME_COCOA)
|
#elif !defined(DESMUME_COCOA)
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2013 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -43,6 +43,7 @@
|
||||||
#include "render3D.h"
|
#include "render3D.h"
|
||||||
#include "gfx3d.h"
|
#include "gfx3d.h"
|
||||||
#include "texcache.h"
|
#include "texcache.h"
|
||||||
|
#include "MMU.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "utils/task.h"
|
#include "utils/task.h"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006-2009 DeSmuME team
|
Copyright (C) 2006-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "readwrite.h"
|
#include "readwrite.h"
|
||||||
#include "types.h"
|
#include "emufile.h"
|
||||||
|
|
||||||
//well. just for the sake of consistency
|
//well. just for the sake of consistency
|
||||||
int write8le(u8 b, EMUFILE*os)
|
int write8le(u8 b, EMUFILE*os)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2008-2009 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,12 +18,14 @@
|
||||||
#ifndef _READWRITE_H_
|
#ifndef _READWRITE_H_
|
||||||
#define _READWRITE_H_
|
#define _READWRITE_H_
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
#include "emufile.h"
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
//well. just for the sake of consistency
|
//well. just for the sake of consistency
|
||||||
int write8le(u8 b, EMUFILE *fp);
|
int write8le(u8 b, EMUFILE *fp);
|
||||||
inline int write8le(u8* b, EMUFILE *fp) { return write8le(*b,fp); }
|
inline int write8le(u8* b, EMUFILE *fp) { return write8le(*b,fp); }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006-2007 shash
|
Copyright (C) 2006-2007 shash
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,6 +17,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "render3D.h"
|
#include "render3D.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "gfx3d.h"
|
#include "gfx3d.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "texcache.h"
|
#include "texcache.h"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Copyright (C) 2006 Normmatt
|
Copyright (C) 2006 Normmatt
|
||||||
Copyright (C) 2006 Theo Berkau
|
Copyright (C) 2006 Theo Berkau
|
||||||
Copyright (C) 2007 Pascal Giard
|
Copyright (C) 2007 Pascal Giard
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -28,11 +28,18 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
#include "armcpu.h"
|
||||||
|
#include "registers.h"
|
||||||
|
#include "FIFO.h"
|
||||||
|
#include "driver.h"
|
||||||
#include "saves.h"
|
#include "saves.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "render3D.h"
|
#include "render3D.h"
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
|
#include "GPU.h"
|
||||||
#include "GPU_osd.h"
|
#include "GPU_osd.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
@ -43,6 +50,8 @@
|
||||||
#include "MMU_timing.h"
|
#include "MMU_timing.h"
|
||||||
#include "slot1.h"
|
#include "slot1.h"
|
||||||
#include "slot2.h"
|
#include "slot2.h"
|
||||||
|
#include "SPU.h"
|
||||||
|
#include "wifi.h"
|
||||||
|
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2010-2013 DeSmuME team
|
Copyright (C) 2010-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -19,9 +19,8 @@
|
||||||
#define __SLOT1_H__
|
#define __SLOT1_H__
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "common.h"
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "debug.h"
|
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
|
|
||||||
class EMUFILE;
|
class EMUFILE;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2013 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -15,9 +15,11 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "slot2.h"
|
#include "slot2.h"
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
|
#include "registers.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
|
|
||||||
//this is the currently-configured cflash mode
|
//this is the currently-configured cflash mode
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009-2013 DeSmuME team
|
Copyright (C) 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -18,12 +18,14 @@
|
||||||
#ifndef __SLOT2_H__
|
#ifndef __SLOT2_H__
|
||||||
#define __SLOT2_H__
|
#define __SLOT2_H__
|
||||||
|
|
||||||
#include "common.h"
|
#include <string>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
#define GBA_SRAM_FILE_EXT "sav"
|
#define GBA_SRAM_FILE_EXT "sav"
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
class Slot2Info
|
class Slot2Info
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2007 shash
|
Copyright (C) 2006-2007 shash
|
||||||
Copyright (C) 2008-2011 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "gfx3d.h"
|
#include "gfx3d.h"
|
||||||
|
#include "MMU.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
|
|
||||||
using std::min;
|
using std::min;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2006-2007 shash
|
Copyright (C) 2006-2007 shash
|
||||||
Copyright (C) 2008-2009 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -20,9 +20,10 @@
|
||||||
#ifndef _TEXCACHE_H_
|
#ifndef _TEXCACHE_H_
|
||||||
#define _TEXCACHE_H_
|
#define _TEXCACHE_H_
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
enum TexCache_TexFormat
|
enum TexCache_TexFormat
|
||||||
{
|
{
|
||||||
TexFormat_None, //used when nothing yet is cached
|
TexFormat_None, //used when nothing yet is cached
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 yopyop
|
Copyright (C) 2006 yopyop
|
||||||
Copyright (C) 2008 shash
|
Copyright (C) 2008 shash
|
||||||
Copyright (C) 2008-2013 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -17,12 +17,16 @@
|
||||||
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
along with the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "armcpu.h"
|
||||||
|
#include "instructions.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "bios.h"
|
#include "bios.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "MMU.h"
|
#include "MMU.h"
|
||||||
#include "NDSSystem.h"
|
#include "NDSSystem.h"
|
||||||
#include "MMU_timing.h"
|
#include "MMU_timing.h"
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#define cpu (&ARMPROC)
|
#define cpu (&ARMPROC)
|
||||||
#define TEMPLATE template<int PROCNUM>
|
#define TEMPLATE template<int PROCNUM>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2005 Guillaume Duhamel
|
Copyright (C) 2005 Guillaume Duhamel
|
||||||
Copyright (C) 2008-2012 DeSmuME team
|
Copyright (C) 2008-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -85,15 +85,20 @@
|
||||||
#define WINAPI
|
#define WINAPI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#if !defined(MAX_PATH)
|
||||||
|
#if defined(HOST_WINDOWS)
|
||||||
|
#define MAX_PATH 260
|
||||||
|
#elif defined(__GNUC__)
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#ifndef PATH_MAX
|
#if !defined(PATH_MAX)
|
||||||
#define MAX_PATH 1024
|
#define MAX_PATH 1024
|
||||||
#else
|
#else
|
||||||
#define MAX_PATH PATH_MAX
|
#define MAX_PATH PATH_MAX
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#define MAX_PATH 1024
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//------------alignment macros-------------
|
//------------alignment macros-------------
|
||||||
//dont apply these to types without further testing. it only works portably here on declarations of variables
|
//dont apply these to types without further testing. it only works portably here on declarations of variables
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011-2013 DeSmuME team
|
Copyright (C) 2011-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -22,7 +22,9 @@
|
||||||
#include "tinyxml/tinyxml.h"
|
#include "tinyxml/tinyxml.h"
|
||||||
|
|
||||||
#include "advanscene.h"
|
#include "advanscene.h"
|
||||||
#include "mc.h"
|
#include "../common.h"
|
||||||
|
#include "../mc.h"
|
||||||
|
#include "../emufile.h"
|
||||||
|
|
||||||
ADVANsCEne advsc;
|
ADVANsCEne advsc;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2011-2013 DeSmuME team
|
Copyright (C) 2011-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -16,8 +16,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "types.h"
|
#include "../types.h"
|
||||||
#include "emufile.h"
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
class ADVANsCEne
|
class ADVANsCEne
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#define __CRC_H
|
#define __CRC_H
|
||||||
|
|
||||||
//#include "little.h" // FixCrc is not yet big endian compatible
|
//#include "little.h" // FixCrc is not yet big endian compatible
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data
|
* Data
|
||||||
|
|
|
@ -21,14 +21,13 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include "decrypt.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "../../types.h"
|
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
#include "header.h"
|
#include "header.h"
|
||||||
#include "decrypt.h"
|
|
||||||
|
|
||||||
//encr_data
|
//encr_data
|
||||||
const unsigned char arm7_key[] =
|
const unsigned char arm7_key[] =
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
#ifndef _DECRYPT_H_
|
#ifndef _DECRYPT_H_
|
||||||
#define _DECRYPT_H_
|
#define _DECRYPT_H_
|
||||||
|
|
||||||
|
#include "../../types.h"
|
||||||
|
|
||||||
extern const unsigned char arm7_key[];
|
extern const unsigned char arm7_key[];
|
||||||
|
|
||||||
//decrypts the secure area of a rom (or does nothing if it is already decrypted)
|
//decrypts the secure area of a rom (or does nothing if it is already decrypted)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2009-2010 DeSmuME team
|
Copyright 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -30,6 +30,7 @@
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "../emufile.h"
|
||||||
|
|
||||||
|
|
||||||
#define LE16(x) (x)
|
#define LE16(x) (x)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2009-2010 DeSmuME team
|
Copyright 2009-2015 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file 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
|
||||||
|
@ -32,9 +32,10 @@
|
||||||
#define EMUFAT_H
|
#define EMUFAT_H
|
||||||
|
|
||||||
#include "emufat_types.h"
|
#include "emufat_types.h"
|
||||||
#include "emufile.h"
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
class EMUFILE;
|
||||||
|
|
||||||
#define BOOTCODE_SIZE 448
|
#define BOOTCODE_SIZE 448
|
||||||
#define BOOTCODE_FAT32_SIZE 420
|
#define BOOTCODE_FAT32_SIZE 420
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue