more cpp conversion

This commit is contained in:
zeromus 2008-09-08 07:32:44 +00:00
parent 67fb83cb5e
commit 106bd5ab5e
46 changed files with 160 additions and 335 deletions

View File

@ -3,10 +3,6 @@
#include "types.h" #include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct { typedef struct {
//ARM9 mem //ARM9 mem
u8 ARM9_ITCM[0x8000]; u8 ARM9_ITCM[0x8000];
@ -34,8 +30,4 @@ typedef struct {
extern ARM9_struct ARM9Mem; extern ARM9_struct ARM9Mem;
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -24,17 +24,9 @@
#include "types.h" #include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern char * (* des_arm_instructions_set[4096])(u32 adr, u32 i, char * txt); extern char * (* des_arm_instructions_set[4096])(u32 adr, u32 i, char * txt);
extern char * (* des_thumb_instructions_set[1024])(u32 adr, u32 i, char * txt); extern char * (* des_thumb_instructions_set[1024])(u32 adr, u32 i, char * txt);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -26,10 +26,6 @@
#include "types.h" #include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct typedef struct
{ {
u32 data[0x8000]; u32 data[0x8000];
@ -56,8 +52,4 @@ typedef struct{
u32 irq; u32 irq;
} GFXFIFO; } GFXFIFO;
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -32,10 +32,6 @@
#include "FIFO.h" #include "FIFO.h"
#include "MMU.h" #include "MMU.h"
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************* /*******************************************************************************
this structure is for display control, this structure is for display control,
@ -816,9 +812,5 @@ void SetupFinalPixelBlitter (GPU *gpu);
#define GPU_setBLDY_EVY(gpu, val) {gpu->BLDY_EVY = (val&0x1f) > 16 ? 16 : (val&0x1f);} #define GPU_setBLDY_EVY(gpu, val) {gpu->BLDY_EVY = (val&0x1f) > 16 ? 16 : (val&0x1f);}
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -2663,7 +2663,7 @@ void FASTCALL MMU_write32(u32 proc, u32 adr, u32 val)
case 1: case 1:
return; return;
} }
T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B4, (u32) sqrt(v)); T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B4, (u32) sqrt((double)v));
T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B0, cnt & 0x7FFF); T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B0, cnt & 0x7FFF);
SQRTLOG("BOUT1 sqrt(%08X%08X) = %08X\r\n", (u32)(v>>32), (u32)v, SQRTLOG("BOUT1 sqrt(%08X%08X) = %08X\r\n", (u32)(v>>32), (u32)v,
T1ReadLong(MMU.MMU_MEM[proc][0x40], 0x2B4)); T1ReadLong(MMU.MMU_MEM[proc][0x40], 0x2B4));
@ -2684,7 +2684,7 @@ void FASTCALL MMU_write32(u32 proc, u32 adr, u32 val)
v = T1ReadQuad(MMU.MMU_MEM[proc][0x40], 0x2B8); v = T1ReadQuad(MMU.MMU_MEM[proc][0x40], 0x2B8);
break; break;
} }
T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B4, (u32) sqrt(v)); T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B4, (u32) sqrt((double)v));
T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B0, cnt & 0x7FFF); T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B0, cnt & 0x7FFF);
SQRTLOG("BOUT2 sqrt(%08X%08X) = %08X\r\n", (u32)(v>>32), (u32)v, SQRTLOG("BOUT2 sqrt(%08X%08X) = %08X\r\n", (u32)(v>>32), (u32)v,
T1ReadLong(MMU.MMU_MEM[proc][0x40], 0x2B4)); T1ReadLong(MMU.MMU_MEM[proc][0x40], 0x2B4));

View File

@ -30,10 +30,6 @@
#include "ARM9.h" #include "ARM9.h"
#include "mc.h" #include "mc.h"
#ifdef __cplusplus
extern "C" {
#endif
extern char szRomPath[512]; extern char szRomPath[512];
extern char szRomBaseName[512]; extern char szRomBaseName[512];
@ -193,9 +189,4 @@ extern struct armcpu_memory_iface arm9_base_memory_iface;
extern struct armcpu_memory_iface arm7_base_memory_iface; extern struct armcpu_memory_iface arm7_base_memory_iface;
extern struct armcpu_memory_iface arm9_direct_memory_iface; extern struct armcpu_memory_iface arm9_direct_memory_iface;
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -195,7 +195,7 @@ BOOL NDS_SetROM(u8 * rom, u32 mask)
NDS_header * NDS_getROMHeader(void) NDS_header * NDS_getROMHeader(void)
{ {
NDS_header * header = malloc(sizeof(NDS_header)); NDS_header * header = new NDS_header();
memcpy(header->gameTile, MMU.CART_ROM, 12); memcpy(header->gameTile, MMU.CART_ROM, 12);
memcpy(header->gameCode, MMU.CART_ROM + 12, 4); memcpy(header->gameCode, MMU.CART_ROM + 12, 4);
@ -306,7 +306,7 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize,
char * p; char * p;
ROMReader_struct * reader; ROMReader_struct * reader;
FILE * file; void* file;
u32 size, mask; u32 size, mask;
u8 *data; u8 *data;
char * noext; char * noext;
@ -532,7 +532,7 @@ void NDS_Reset( void)
MMU_write32(0, 0x0000010, 0xE3B02020); MMU_write32(0, 0x0000010, 0xE3B02020);
// MMU_write32(0, 0x0000010, 0xE2100202); // MMU_write32(0, 0x0000010, 0xE2100202);
free(header); delete header;
GPU_Reset(MainScreen.gpu, 0); GPU_Reset(MainScreen.gpu, 0);
GPU_Reset(SubScreen.gpu, 1); GPU_Reset(SubScreen.gpu, 1);

View File

@ -31,11 +31,6 @@
#include "mem.h" #include "mem.h"
#include "wifi.h" #include "wifi.h"
#ifdef __cplusplus
extern "C" {
#endif
extern volatile BOOL execute; extern volatile BOOL execute;
extern BOOL click; extern BOOL click;
@ -243,10 +238,6 @@ NDS_exec(s32 nb, BOOL force);
int NDS_WriteBMP_32bppBuffer(int width, int height, const void* buf, const char *filename); int NDS_WriteBMP_32bppBuffer(int width, int height, const void* buf, const char *filename);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -23,9 +23,6 @@
#ifdef HAVE_LIBZZIP #ifdef HAVE_LIBZZIP
#include <zzip/zzip.h> #include <zzip/zzip.h>
#endif #endif
#ifdef WIN32
#define strcasecmp stricmp
#endif
ROMReader_struct * ROMReaderInit(char ** filename) ROMReader_struct * ROMReaderInit(char ** filename)
{ {
@ -71,7 +68,7 @@ void * STDROMReaderInit(const char * filename)
void STDROMReaderDeInit(void * file) void STDROMReaderDeInit(void * file)
{ {
if (!file) return ; if (!file) return ;
fclose(file); fclose((FILE*)file);
} }
u32 STDROMReaderSize(void * file) u32 STDROMReaderSize(void * file)
@ -80,9 +77,9 @@ u32 STDROMReaderSize(void * file)
if (!file) return 0 ; if (!file) return 0 ;
fseek(file, 0, SEEK_END); fseek((FILE*)file, 0, SEEK_END);
size = ftell(file); size = ftell((FILE*)file);
fseek(file, 0, SEEK_SET); fseek((FILE*)file, 0, SEEK_SET);
return size; return size;
} }
@ -90,13 +87,13 @@ u32 STDROMReaderSize(void * file)
int STDROMReaderSeek(void * file, int offset, int whence) int STDROMReaderSeek(void * file, int offset, int whence)
{ {
if (!file) return 0 ; if (!file) return 0 ;
return fseek(file, offset, whence); return fseek((FILE*)file, offset, whence);
} }
int STDROMReaderRead(void * file, void * buffer, u32 size) int STDROMReaderRead(void * file, void * buffer, u32 size)
{ {
if (!file) return 0 ; if (!file) return 0 ;
return fread(buffer, 1, size, file); return fread(buffer, 1, size, (FILE*)file);
} }
#ifdef HAVE_LIBZ #ifdef HAVE_LIBZ
@ -188,7 +185,7 @@ void * ZIPROMReaderInit(const char * filename)
void ZIPROMReaderDeInit(void * file) void ZIPROMReaderDeInit(void * file)
{ {
zzip_close(file); zzip_close((ZZIP_FILE*)file);
} }
u32 ZIPROMReaderSize(void * file) u32 ZIPROMReaderSize(void * file)
@ -197,20 +194,20 @@ u32 ZIPROMReaderSize(void * file)
u32 tmp; u32 tmp;
u32 size = 0; u32 size = 0;
zzip_seek(file, 0, SEEK_END); zzip_seek((ZZIP_FILE*)file, 0, SEEK_END);
size = zzip_tell(file); size = zzip_tell((ZZIP_FILE*)file);
zzip_seek(file, 0, SEEK_SET); zzip_seek((ZZIP_FILE*)file, 0, SEEK_SET);
return size; return size;
} }
int ZIPROMReaderSeek(void * file, int offset, int whence) int ZIPROMReaderSeek(void * file, int offset, int whence)
{ {
return zzip_seek(file, offset, whence); return zzip_seek((ZZIP_FILE*)file, offset, whence);
} }
int ZIPROMReaderRead(void * file, void * buffer, u32 size) int ZIPROMReaderRead(void * file, void * buffer, u32 size)
{ {
return zzip_read(file, buffer, size); return zzip_read((ZZIP_FILE*)file, buffer, size);
} }
#endif #endif

View File

@ -87,10 +87,10 @@ int SPU_ChangeSoundCore(int coreid, int buffersize)
SNDCore->DeInit(); SNDCore->DeInit();
// Allocate memory for sound buffer // Allocate memory for sound buffer
if ((SPU->sndbuf = malloc(buffersize * 4 * 2)) == NULL) if ((SPU->sndbuf = new s32[buffersize * 2]) == NULL)
return -1; return -1;
if ((SPU->outbuf = malloc(buffersize * 2 * 2)) == NULL) if ((SPU->outbuf = new s16[buffersize * 2]) == NULL)
return -1; return -1;
memset(SPU->sndbuf, 0, buffersize * 4 * 2); memset(SPU->sndbuf, 0, buffersize * 4 * 2);
@ -180,10 +180,10 @@ void SPU_Reset(void)
void SPU_DeInit(void) void SPU_DeInit(void)
{ {
if (SPU->sndbuf) if (SPU->sndbuf)
free(SPU->sndbuf); delete[] SPU->sndbuf;
if (SPU->outbuf) if (SPU->outbuf)
free(SPU->outbuf); delete[] SPU->outbuf;
if (SNDCore) if (SNDCore)
SNDCore->DeInit(); SNDCore->DeInit();
@ -204,13 +204,13 @@ void SPU_KeyOn(int channel)
switch(chan->format) switch(chan->format)
{ {
case 0: // 8-bit case 0: // 8-bit
chan->buf8 = &MMU.MMU_MEM[1][(chan->addr>>20)&0xFF][(chan->addr & MMU.MMU_MASK[1][(chan->addr >> 20) & 0xFF])]; chan->buf8 = (s8*)&MMU.MMU_MEM[1][(chan->addr>>20)&0xFF][(chan->addr & MMU.MMU_MASK[1][(chan->addr >> 20) & 0xFF])];
chan->loopstart = chan->loopstart << 2; chan->loopstart = chan->loopstart << 2;
chan->length = (chan->length << 2) + chan->loopstart; chan->length = (chan->length << 2) + chan->loopstart;
chan->sampcnt = 0; chan->sampcnt = 0;
break; break;
case 1: // 16-bit case 1: // 16-bit
chan->buf16 = (u16 *)&MMU.MMU_MEM[1][(chan->addr>>20)&0xFF][(chan->addr & MMU.MMU_MASK[1][(chan->addr >> 20) & 0xFF])]; chan->buf16 = (s16 *)&MMU.MMU_MEM[1][(chan->addr>>20)&0xFF][(chan->addr & MMU.MMU_MASK[1][(chan->addr >> 20) & 0xFF])];
chan->loopstart = chan->loopstart << 1; chan->loopstart = chan->loopstart << 1;
chan->length = (chan->length << 1) + chan->loopstart; chan->length = (chan->length << 1) + chan->loopstart;
chan->sampcnt = 0; chan->sampcnt = 0;
@ -219,7 +219,7 @@ void SPU_KeyOn(int channel)
{ {
u32 temp; u32 temp;
chan->buf8 = &MMU.MMU_MEM[1][(chan->addr>>20)&0xFF][(chan->addr & MMU.MMU_MASK[1][(chan->addr >> 20) & 0xFF])]; chan->buf8 = (s8*)&MMU.MMU_MEM[1][(chan->addr>>20)&0xFF][(chan->addr & MMU.MMU_MASK[1][(chan->addr >> 20) & 0xFF])];
chan->pcm16b = (s16)((chan->buf8[1] << 8) | chan->buf8[0]); chan->pcm16b = (s16)((chan->buf8[1] << 8) | chan->buf8[0]);
chan->index = chan->buf8[2] & 0x7F; chan->index = chan->buf8[2] & 0x7F;
chan->lastsampcnt = 7; chan->lastsampcnt = 7;

View File

@ -22,10 +22,6 @@
#include "types.h" #include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SNDCORE_DEFAULT -1 #define SNDCORE_DEFAULT -1
#define SNDCORE_DUMMY 0 #define SNDCORE_DUMMY 0
#define SNDCORE_FILEWRITE 1 #define SNDCORE_FILEWRITE 1
@ -95,8 +91,4 @@ void SPU_WriteLong(u32 addr, u32 val);
u32 SPU_ReadLong(u32 addr); u32 SPU_ReadLong(u32 addr);
void SPU_Emulate(void); void SPU_Emulate(void);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -22,10 +22,16 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
//zero 9/8/08 - fixed a bug
//SIGNED_UNDERFLOW(a, (!cpu->CPSR.bits.C), tmp)
//was being called. but SIGNED_UNDERFLOW expects values in bit31. replaced with
//SIGNED_UNDERFLOW(a, (cpu->CPSR.bits.C?0:0x80000000), tmp)
#include "cp15.h" #include "cp15.h"
#include "debug.h" #include "debug.h"
#include "MMU.h" #include "MMU.h"
BOOL execute;
// Use this macros for reading/writing, so the GDB stub isn't broken // Use this macros for reading/writing, so the GDB stub isn't broken
#ifdef GDB_STUB #ifdef GDB_STUB
@ -235,8 +241,6 @@
#define IMM_OFF_12 ((i)&0xFFF) #define IMM_OFF_12 ((i)&0xFFF)
extern BOOL execute;
static u32 FASTCALL OP_UND(armcpu_t *cpu) static u32 FASTCALL OP_UND(armcpu_t *cpu)
{ {
u32 i = cpu->instruction; u32 i = cpu->instruction;
@ -1331,8 +1335,8 @@ static u32 FASTCALL OP_SBC_IMM_VAL(armcpu_t *cpu)
}\ }\
cpu->CPSR.bits.N = BIT31(cpu->R[REG_POS(i,12)]);\ cpu->CPSR.bits.N = BIT31(cpu->R[REG_POS(i,12)]);\
cpu->CPSR.bits.Z = (cpu->R[REG_POS(i,12)]==0);\ cpu->CPSR.bits.Z = (cpu->R[REG_POS(i,12)]==0);\
cpu->CPSR.bits.C = (!UNSIGNED_UNDERFLOW(v, (!cpu->CPSR.bits.C), tmp)) & (!UNSIGNED_UNDERFLOW(tmp, shift_op, cpu->R[REG_POS(i,12)]));\ cpu->CPSR.bits.C = (!UNSIGNED_UNDERFLOW(v, (cpu->CPSR.bits.C?0:0x80000000), tmp)) & (!UNSIGNED_UNDERFLOW(tmp, shift_op, cpu->R[REG_POS(i,12)]));\
cpu->CPSR.bits.V = SIGNED_UNDERFLOW(v, (!cpu->CPSR.bits.C), tmp) | SIGNED_UNDERFLOW(tmp, shift_op, cpu->R[REG_POS(i,12)]);\ cpu->CPSR.bits.V = SIGNED_UNDERFLOW(v, (cpu->CPSR.bits.C?0:0x80000000), tmp) | SIGNED_UNDERFLOW(tmp, shift_op, cpu->R[REG_POS(i,12)]);\
return a; \ return a; \
} }
@ -1504,8 +1508,8 @@ static u32 FASTCALL OP_RSC_IMM_VAL(armcpu_t *cpu)
}\ }\
cpu->CPSR.bits.N = BIT31(cpu->R[REG_POS(i,12)]);\ cpu->CPSR.bits.N = BIT31(cpu->R[REG_POS(i,12)]);\
cpu->CPSR.bits.Z = (cpu->R[REG_POS(i,12)]==0);\ cpu->CPSR.bits.Z = (cpu->R[REG_POS(i,12)]==0);\
cpu->CPSR.bits.C = (!UNSIGNED_UNDERFLOW(shift_op, (!cpu->CPSR.bits.C), tmp)) & (!UNSIGNED_UNDERFLOW(tmp, v, cpu->R[REG_POS(i,12)]));\ cpu->CPSR.bits.C = (!UNSIGNED_UNDERFLOW(shift_op, (cpu->CPSR.bits.C?0:0x80000000), tmp)) & (!UNSIGNED_UNDERFLOW(tmp, v, cpu->R[REG_POS(i,12)]));\
cpu->CPSR.bits.V = SIGNED_UNDERFLOW(shift_op, (!cpu->CPSR.bits.C), tmp) | SIGNED_UNDERFLOW(tmp, v, cpu->R[REG_POS(i,12)]);\ cpu->CPSR.bits.V = SIGNED_UNDERFLOW(shift_op, (cpu->CPSR.bits.C?0:0x80000000), tmp) | SIGNED_UNDERFLOW(tmp, v, cpu->R[REG_POS(i,12)]);\
return a; \ return a; \
} }

View File

@ -26,10 +26,6 @@
#include "bits.h" #include "bits.h"
#include "MMU.h" #include "MMU.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ARMCPU_ARM7 1 #define ARMCPU_ARM7 1
#define ARMCPU_ARM9 0 #define ARMCPU_ARM9 0
@ -280,9 +276,4 @@ static INLINE void NDS_makeInt(u8 proc_ID,u32 num)
} }
} }
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -332,6 +332,7 @@ static BOOL cflash_build_fat( void) {
numExtraEntries[i] = 0; numExtraEntries[i] = 0;
} }
//COMMENT OUT THIS LINE TO STOP THE IRRITATING FILESYSTEM SCANNING BEHAVIOR
list_files(sRomPath); list_files(sRomPath);
k = 0; k = 0;

View File

@ -8,10 +8,6 @@
#include "fat.h" #include "fat.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct { typedef struct {
int level,parent,filesInDir; int level,parent,filesInDir;
} FILE_INFO; } FILE_INFO;
@ -25,8 +21,4 @@ void cflash_write(unsigned int address,unsigned int data);
void cflash_close( void); void cflash_close( void);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -3,5 +3,5 @@ include $(top_srcdir)/src/desmume.mk
AM_CFLAGS += $(SDL_CFLAGS) AM_CFLAGS += $(SDL_CFLAGS)
bin_PROGRAMS = desmume-cli bin_PROGRAMS = desmume-cli
desmume_cli_SOURCES = main.c ../sndsdl.c ../ctrlssdl.h ../ctrlssdl.c desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp
desmume_cli_LDADD = ../libdesmume.a ../gdbstub/libgdbstub.a $(SDL_LIBS) desmume_cli_LDADD = ../libdesmume.a ../gdbstub/libgdbstub.a $(SDL_LIBS)

View File

@ -23,10 +23,6 @@
#include "types.h" #include "types.h"
#include <stdio.h> #include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { DEBUG_STRING, DEBUG_STREAM , DEBUG_STDOUT, DEBUG_STDERR } DebugOutType; typedef enum { DEBUG_STRING, DEBUG_STREAM , DEBUG_STDOUT, DEBUG_STDERR } DebugOutType;
typedef struct { typedef struct {
@ -90,8 +86,4 @@ void LogStop(void);
#define DMALOG(...) #define DMALOG(...)
#endif #endif
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -22,10 +22,6 @@
#include "types.h" #include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define FS_IS_DIR 1 #define FS_IS_DIR 1
#define FS_ERR_UNKNOWN -1 #define FS_ERR_UNKNOWN -1
@ -45,8 +41,4 @@ int FsReadNext(void * search, FsEntry * entry);
void FsClose(void * search); void FsClose(void * search);
int FsError(void); int FsError(void);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -27,9 +27,6 @@ typedef void *gdbstub_handle_t;
/* /*
* The function interface * The function interface
*/ */
#ifdef __cplusplus
extern "C" {
#endif
gdbstub_handle_t gdbstub_handle_t
createStub_gdb( u16 port, createStub_gdb( u16 port,
@ -44,20 +41,21 @@ activateStub_gdb( gdbstub_handle_t stub,
struct armcpu_ctrl_iface *cpu_ctrl); struct armcpu_ctrl_iface *cpu_ctrl);
#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif
/* /*
* An implementation of the following functions is required * An implementation of the following functions is required
* for the GDB stub to function. * for the GDB stub to function.
*/ */
void * EXTERNC void *
createThread_gdb( void (*thread_function)( void *data), createThread_gdb( void (*thread_function)( void *data),
void *thread_data); void *thread_data);
void EXTERNC void
joinThread_gdb( void *thread_handle); joinThread_gdb( void *thread_handle);
#ifdef __cplusplus
}
#endif
#endif /* End of _GDBSTUB_H_ */ #endif /* End of _GDBSTUB_H_ */

View File

@ -31,7 +31,7 @@ TYPE_RETOUR (*CALLTYPE NOM_TAB[4096])(PARAMETRES)={
OP_AND_LSL_IMM, // 000 0000 0 1000 OP_AND_LSL_IMM, // 000 0000 0 1000
OP_MUL, // 000 0000 0 1001 OP_MUL, // 000 0000 0 1001
OP_AND_LSR_IMM, // OOO OOOO O 1010 OP_AND_LSR_IMM, // 000 0000 0 1010
OP_STRH_POS_INDE_M_REG_OFF, // 000 0000 0 1011 OP_STRH_POS_INDE_M_REG_OFF, // 000 0000 0 1011
OP_AND_ASR_IMM, // 000 0000 0 1100 OP_AND_ASR_IMM, // 000 0000 0 1100
OP_LDRD_STRD_POST_INDEX, OP_LDRD_STRD_POST_INDEX,

View File

@ -24,38 +24,16 @@
#include <math.h> #include <math.h>
#include "matrix.h" #include "matrix.h"
extern "C" {
void MatrixInit (float *matrix) void MatrixInit (float *matrix)
{ {
memset (matrix, 0, sizeof(float)*16); memset (matrix, 0, sizeof(float)*16);
matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.f; matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.f;
} }
#ifdef SSE2 #ifndef SSE2
void __fastcall MatrixIdentity (float *matrix) //============== TODO void __fastcall MatrixMultVec4x4 (const float *matrix, float *vecPtr)
{
memset (matrix, 0, sizeof(float)*16);
matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.f;
}
float __fastcall MatrixGetMultipliedIndex (int index, float *matrix, float *rightMatrix)
{
int iMod = index%4, iDiv = (index>>2)<<2;
return (matrix[iMod ]*rightMatrix[iDiv ])+(matrix[iMod+ 4]*rightMatrix[iDiv+1])+
(matrix[iMod+8]*rightMatrix[iDiv+2])+(matrix[iMod+12]*rightMatrix[iDiv+3]);
}
void __fastcall MatrixSet (float *matrix, int x, int y, float value) // TODO
{
matrix [x+(y<<2)] = value;
}
void __fastcall MatrixCopy (float *matrixDST, float *matrixSRC)
{
memcpy (matrixDST, matrixSRC, sizeof(float)*16);
}
#else
void MatrixMultVec4x4 (float *matrix, float *vecPtr)
{ {
float x = vecPtr[0]; float x = vecPtr[0];
float y = vecPtr[1]; float y = vecPtr[1];
@ -68,7 +46,7 @@ void MatrixMultVec4x4 (float *matrix, float *vecPtr)
vecPtr[3] = x * matrix[3] + y * matrix[7] + z * matrix[11] + w * matrix[15]; vecPtr[3] = x * matrix[3] + y * matrix[7] + z * matrix[11] + w * matrix[15];
} }
void MatrixMultVec3x3 (float *matrix, float *vecPtr) void __fastcall MatrixMultVec3x3 (const float *matrix, float *vecPtr)
{ {
float x = vecPtr[0]; float x = vecPtr[0];
float y = vecPtr[1]; float y = vecPtr[1];
@ -79,14 +57,7 @@ void MatrixMultVec3x3 (float *matrix, float *vecPtr)
vecPtr[2] = x * matrix[2] + y * matrix[6] + z * matrix[10]; vecPtr[2] = x * matrix[2] + y * matrix[6] + z * matrix[10];
} }
void MatrixIdentity (float *matrix) void __fastcall MatrixMultiply (float *matrix, const float *rightMatrix)
{
memset (matrix, 0, sizeof(float)*16);
matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.f;
}
void MatrixMultiply (float *matrix, float *rightMatrix)
{ {
float tmpMatrix[16]; float tmpMatrix[16];
@ -113,50 +84,7 @@ void MatrixMultiply (float *matrix, float *rightMatrix)
memcpy (matrix, tmpMatrix, sizeof(float)*16); memcpy (matrix, tmpMatrix, sizeof(float)*16);
} }
float MatrixGetMultipliedIndex (int index, float *matrix, float *rightMatrix) void __fastcall MatrixTranslate (float *matrix, const float *ptr)
{
int iMod = index%4, iDiv = (index>>2)<<2;
return (matrix[iMod ]*rightMatrix[iDiv ])+(matrix[iMod+ 4]*rightMatrix[iDiv+1])+
(matrix[iMod+8]*rightMatrix[iDiv+2])+(matrix[iMod+12]*rightMatrix[iDiv+3]);
}
void MatrixSet (float *matrix, int x, int y, float value)
{
matrix [x+(y<<2)] = value;
}
void MatrixTranspose(float *matrix)
{
float temp;
#define swap(A,B) temp = matrix[A];matrix[A] = matrix[B]; matrix[B] = temp;
swap(1,4);
swap(2,8);
swap(3,0xC);
swap(6,9);
swap(7,0xD);
swap(0xB,0xE);
#undef swap
/*
0 1 2 3
4 5 6 7
8 9 A B
C D E F
0 4 8 C
1 5 9 D
2 6 A E
3 7 B F
*/
}
void MatrixCopy (float *matrixDST, float *matrixSRC)
{
memcpy (matrixDST, matrixSRC, sizeof(float)*16);
}
void MatrixTranslate (float *matrix, float *ptr)
{ {
matrix[12] += (matrix[0]*ptr[0])+(matrix[4]*ptr[1])+(matrix[ 8]*ptr[2]); matrix[12] += (matrix[0]*ptr[0])+(matrix[4]*ptr[1])+(matrix[ 8]*ptr[2]);
matrix[13] += (matrix[1]*ptr[0])+(matrix[5]*ptr[1])+(matrix[ 9]*ptr[2]); matrix[13] += (matrix[1]*ptr[0])+(matrix[5]*ptr[1])+(matrix[ 9]*ptr[2]);
@ -164,7 +92,7 @@ void MatrixTranslate (float *matrix, float *ptr)
matrix[15] += (matrix[3]*ptr[0])+(matrix[7]*ptr[1])+(matrix[11]*ptr[2]); matrix[15] += (matrix[3]*ptr[0])+(matrix[7]*ptr[1])+(matrix[11]*ptr[2]);
} }
void MatrixScale (float *matrix, float *ptr) void __fastcall MatrixScale (float *matrix, const float *ptr)
{ {
matrix[0] *= ptr[0]; matrix[0] *= ptr[0];
matrix[1] *= ptr[0]; matrix[1] *= ptr[0];
@ -181,9 +109,46 @@ void MatrixScale (float *matrix, float *ptr)
matrix[10] *= ptr[2]; matrix[10] *= ptr[2];
matrix[11] *= ptr[2]; matrix[11] *= ptr[2];
} }
#endif #endif //switched c/asm functions
//----------------------------------------- //-----------------------------------------
void MatrixTranspose(float *matrix)
{
float temp;
#define swap(A,B) temp = matrix[A];matrix[A] = matrix[B]; matrix[B] = temp;
swap(1,4);
swap(2,8);
swap(3,0xC);
swap(6,9);
swap(7,0xD);
swap(0xB,0xE);
#undef swap
}
void __fastcall MatrixIdentity (float *matrix) //============== TODO
{
memset (matrix, 0, sizeof(float)*16);
matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.f;
}
float __fastcall MatrixGetMultipliedIndex (int index, float *matrix, float *rightMatrix)
{
int iMod = index%4, iDiv = (index>>2)<<2;
return (matrix[iMod ]*rightMatrix[iDiv ])+(matrix[iMod+ 4]*rightMatrix[iDiv+1])+
(matrix[iMod+8]*rightMatrix[iDiv+2])+(matrix[iMod+12]*rightMatrix[iDiv+3]);
}
void __fastcall MatrixSet (float *matrix, int x, int y, float value) // TODO
{
matrix [x+(y<<2)] = value;
}
void __fastcall MatrixCopy (float* matrixDST, const float* matrixSRC)
{
memcpy ((void*)matrixDST, matrixSRC, sizeof(float)*16);
}
void MatrixStackInit (MatrixStack *stack) void MatrixStackInit (MatrixStack *stack)
{ {
stack->matrix = NULL; stack->matrix = NULL;
@ -226,7 +191,7 @@ void MatrixStackSetStackPosition (MatrixStack *stack, int pos)
stack->position = stack->size; stack->position = stack->size;
} }
void MatrixStackPushMatrix (MatrixStack *stack, float *ptr) void MatrixStackPushMatrix (MatrixStack *stack, const float *ptr)
{ {
MatrixCopy (&stack->matrix[stack->position*16], ptr); MatrixCopy (&stack->matrix[stack->position*16], ptr);
@ -250,38 +215,38 @@ float * MatrixStackGet (MatrixStack *stack)
return &stack->matrix[stack->position*16]; return &stack->matrix[stack->position*16];
} }
void MatrixStackLoadMatrix (MatrixStack *stack, int pos, float *ptr) void MatrixStackLoadMatrix (MatrixStack *stack, int pos, const float *ptr)
{ {
MatrixCopy (&stack->matrix[pos*16], ptr); MatrixCopy (&stack->matrix[pos*16], ptr);
} }
float Vector3Dot(float *a, float *b) float Vector3Dot(const float *a, const float *b)
{ {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
} }
float Vector3Length(float *a) float Vector3Length(const float *a)
{ {
float lengthSquared = Vector3Dot(a,a); float lengthSquared = Vector3Dot(a,a);
float length = sqrt(lengthSquared); float length = sqrt(lengthSquared);
return length; return length;
} }
void Vector3Add(float *dst, float *src) void Vector3Add(float *dst, const float *src)
{ {
dst[0] += src[0]; dst[0] += src[0];
dst[1] += src[1]; dst[1] += src[1];
dst[2] += src[2]; dst[2] += src[2];
} }
void Vector3Scale(float *dst, float scale) void Vector3Scale(float *dst, const float scale)
{ {
dst[0] *= scale; dst[0] *= scale;
dst[1] *= scale; dst[1] *= scale;
dst[2] *= scale; dst[2] *= scale;
} }
void Vector3Copy(float *dst, float *src) void Vector3Copy(float *dst, const float *src)
{ {
dst[0] = src[0]; dst[0] = src[0];
dst[1] = src[1]; dst[1] = src[1];
@ -294,10 +259,12 @@ void Vector3Normalize(float *dst)
Vector3Scale(dst,1.0f/length); Vector3Scale(dst,1.0f/length);
} }
void Vector4Copy(float *dst, float *src) void Vector4Copy(float *dst, const float *src)
{ {
dst[0] = src[0]; dst[0] = src[0];
dst[1] = src[1]; dst[1] = src[1];
dst[2] = src[2]; dst[2] = src[2];
dst[3] = src[3]; dst[3] = src[3];
} }
} //extern "C"

View File

@ -23,9 +23,7 @@
#include "types.h" #include "types.h"
#ifdef __cplusplus
extern "C" { extern "C" {
#endif
#ifdef SSE2 #ifdef SSE2
#include <xmmintrin.h> #include <xmmintrin.h>
@ -48,51 +46,36 @@ typedef struct MatrixStack
} MatrixStack; } MatrixStack;
void MatrixInit (float *matrix); void MatrixInit (float *matrix);
#ifdef SSE2
extern void __fastcall MatrixMultVec3x3 (const gMatrix matrix, const gMatrix vecPtr); void __fastcall MatrixMultVec3x3 (const float * matrix, float * vecPtr);
extern void __fastcall MatrixMultVec4x4 (const gMatrix matrix, const gMatrix vecPtr); void __fastcall MatrixMultVec4x4 (const float * matrix, float * vecPtr);
void __fastcall MatrixIdentity (float *matrix); void __fastcall MatrixMultiply (float * matrix, const float * rightMatrix);
extern void __fastcall MatrixMultiply (const gMatrix matrix, const gMatrix rightMatrix); void __fastcall MatrixTranslate (float *matrix, const float *ptr);
void __fastcall MatrixScale (float * matrix, const float * ptr);
float __fastcall MatrixGetMultipliedIndex (int index, float *matrix, float *rightMatrix); float __fastcall MatrixGetMultipliedIndex (int index, float *matrix, float *rightMatrix);
void __fastcall MatrixSet (float *matrix, int x, int y, float value); void __fastcall MatrixSet (float *matrix, int x, int y, float value);
void __fastcall MatrixCopy (const gMatrix matrixDST, const gMatrix matrixSRC); void __fastcall MatrixCopy (float * matrixDST, const float * matrixSRC);
extern void __fastcall MatrixTranslate (float *matrix, float *ptr); void __fastcall MatrixIdentity (float *matrix);
extern void __fastcall MatrixScale (const gMatrix matrix, const gMatrix ptr);
void __fastcall MatrixScale (const gMatrix matrix, const gMatrix ptr);
#else
void MatrixMultVec3x3 (float *matrix, float *vecPtr);
void MatrixMultVec4x4 (float *matrix, float *vecPtr);
void MatrixIdentity (float *matrix);
void MatrixMultiply (float *matrix, float *rightMatrix);
float MatrixGetMultipliedIndex(int index, float *matrix, float *rightMatrix);
void MatrixSet (float *matrix, int x, int y, float value);
void MatrixCopy (float *matrixDST, float *matrixSRC);
void MatrixTranslate (float *matrix, float *ptr);
void MatrixScale (float *matrix, float *ptr);
#endif
void MatrixTranspose (float *matrix); void MatrixTranspose (float *matrix);
void MatrixStackInit (MatrixStack *stack); void MatrixStackInit (MatrixStack *stack);
void MatrixStackSetMaxSize (MatrixStack *stack, int size); void MatrixStackSetMaxSize (MatrixStack *stack, int size);
void MatrixStackSetStackPosition (MatrixStack *stack, int pos); void MatrixStackSetStackPosition (MatrixStack *stack, int pos);
void MatrixStackPushMatrix (MatrixStack *stack, float *ptr); void MatrixStackPushMatrix (MatrixStack *stack, const float *ptr);
float* MatrixStackPopMatrix (MatrixStack *stack, int size); float* MatrixStackPopMatrix (MatrixStack *stack, int size);
float* MatrixStackGetPos (MatrixStack *stack, int pos); float* MatrixStackGetPos (MatrixStack *stack, int pos);
float* MatrixStackGet (MatrixStack *stack); float* MatrixStackGet (MatrixStack *stack);
void MatrixStackLoadMatrix (MatrixStack *stack, int pos, float *ptr); void MatrixStackLoadMatrix (MatrixStack *stack, int pos, const float *ptr);
float Vector3Dot(float *a, float *b); float Vector3Dot(const float *a, const float *b);
float Vector3Length(float *a); float Vector3Length(const float *a);
void Vector3Add(float *dst, float *src); void Vector3Add(float *dst, const float *src);
void Vector3Scale(float *dst, float scale); void Vector3Scale(float *dst, const float scale);
void Vector3Copy(float *dst, float *src); void Vector3Copy(float *dst, const float *src);
void Vector3Normalize(float *dst); void Vector3Normalize(float *dst);
void Vector4Copy(float *dst, float *src); void Vector4Copy(float *dst, const float *src);
#ifdef __cplusplus } //extern "C"
}
#endif
#endif #endif

View File

@ -80,7 +80,7 @@ void mc_init(memory_chip_t *mc, int type)
u8 *mc_alloc(memory_chip_t *mc, u32 size) u8 *mc_alloc(memory_chip_t *mc, u32 size)
{ {
u8 *buffer; u8 *buffer;
buffer = malloc(size); buffer = new u8[size];
mc->data = buffer; mc->data = buffer;
if(!buffer) { return NULL; } if(!buffer) { return NULL; }
@ -92,7 +92,7 @@ u8 *mc_alloc(memory_chip_t *mc, u32 size)
void mc_free(memory_chip_t *mc) void mc_free(memory_chip_t *mc)
{ {
if(mc->data) free(mc->data); if(mc->data) delete[] mc->data;
mc_init(mc, 0); mc_init(mc, 0);
} }

View File

@ -21,10 +21,6 @@
#ifndef __FW_H__ #ifndef __FW_H__
#define __FW_H__ #define __FW_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h> #include <stdio.h>
#include "types.h" #include "types.h"
@ -86,9 +82,5 @@ void mc_reset_com(memory_chip_t *mc); /* reset communication with mc */
u8 fw_transfer(memory_chip_t *mc, u8 data); /* transfer to, then receive data from firmware */ u8 fw_transfer(memory_chip_t *mc, u8 data); /* transfer to, then receive data from firmware */
u8 bm_transfer(memory_chip_t *mc, u8 data); /* transfer to, then receive data from backup memory */ u8 bm_transfer(memory_chip_t *mc, u8 data); /* transfer to, then receive data from backup memory */
#ifdef __cplusplus
}
#endif
#endif /*__FW_H__*/ #endif /*__FW_H__*/

View File

@ -27,10 +27,6 @@
#define CALL_CONVENTION #define CALL_CONVENTION
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
/* /*
enum DRIVER_3D enum DRIVER_3D
{ {
@ -146,8 +142,4 @@ extern GPU3DInterface *gpu3D;
void NDS_3D_SetDriver (int core3DIndex); void NDS_3D_SetDriver (int core3DIndex);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -30,6 +30,8 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h> #include <time.h>
savestates_t savestates[NB_STATES];
#define SAVESTATE_VERSION 010 #define SAVESTATE_VERSION 010
#ifndef MAX_PATH #ifndef MAX_PATH

View File

@ -21,10 +21,6 @@
#ifndef _SRAM_H #ifndef _SRAM_H
#define _SRAM_H #define _SRAM_H
#ifdef __cplusplus
extern "C" {
#endif
#include "types.h" #include "types.h"
#define SRAM_ADDRESS 0x0A000000 #define SRAM_ADDRESS 0x0A000000
@ -37,7 +33,7 @@ typedef struct
char date[40]; char date[40];
} savestates_t; } savestates_t;
savestates_t savestates[NB_STATES]; extern savestates_t savestates[NB_STATES];
void clear_savestates(); void clear_savestates();
void scan_savestates(); void scan_savestates();
@ -52,8 +48,4 @@ int savestate_save (const char *file_name);
void savestate_slot(int num); void savestate_slot(int num);
void loadstate_slot(int num); void loadstate_slot(int num);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -24,6 +24,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
//zero 9/8/08 - fixed a bug
//SIGNED_UNDERFLOW(a, (!cpu->CPSR.bits.C), tmp)
//was being called. but SIGNED_UNDERFLOW expects values in bit31. replaced with
//SIGNED_UNDERFLOW(a, (cpu->CPSR.bits.C?0:0x80000000), tmp)
#include "bios.h" #include "bios.h"
#include "debug.h" #include "debug.h"
#include "MMU.h" #include "MMU.h"
@ -365,8 +370,8 @@ static u32 FASTCALL OP_SBC_REG(armcpu_t *cpu)
cpu->CPSR.bits.N = BIT31(res); cpu->CPSR.bits.N = BIT31(res);
cpu->CPSR.bits.Z = res == 0; cpu->CPSR.bits.Z = res == 0;
cpu->CPSR.bits.C = (!UNSIGNED_UNDERFLOW(a, !cpu->CPSR.bits.C, tmp)) & (!UNSIGNED_OVERFLOW(tmp, b, res)); cpu->CPSR.bits.C = (!UNSIGNED_UNDERFLOW(a, (cpu->CPSR.bits.C?0:0x80000000), tmp)) & (!UNSIGNED_OVERFLOW(tmp, b, res));
cpu->CPSR.bits.V = SIGNED_UNDERFLOW(a, !cpu->CPSR.bits.C, tmp) | SIGNED_OVERFLOW(tmp, b, res); cpu->CPSR.bits.V = SIGNED_UNDERFLOW(a, (cpu->CPSR.bits.C?0:0x80000000), tmp) | SIGNED_OVERFLOW(tmp, b, res);
return 3; return 3;
} }

View File

@ -22,10 +22,6 @@
#ifndef WIFI_H #ifndef WIFI_H
#define WIFI_H #define WIFI_H
#ifdef __cplusplus
extern "C" {
#endif
/* standardize socket interface for linux and windows */ /* standardize socket interface for linux and windows */
#ifdef WIN32 #ifdef WIN32
#include <winsock2.h> #include <winsock2.h>
@ -459,10 +455,6 @@ extern u8 FW_RFChannel[6*14] ;
extern u8 FW_BBChannel[14] ; extern u8 FW_BBChannel[14] ;
extern u8 FW_WFCProfile[0xC0] ; extern u8 FW_WFCProfile[0xC0] ;
#ifdef __cplusplus
}
#endif
#endif #endif
#endif /* #ifdef EXPERIMENTAL_WIFI */ #endif /* #ifdef EXPERIMENTAL_WIFI */

View File

@ -546,19 +546,19 @@
> >
</File> </File>
<File <File
RelativePath="..\arm_instructions.c" RelativePath="..\arm_instructions.cpp"
> >
</File> </File>
<File <File
RelativePath="..\armcpu.c" RelativePath="..\armcpu.cpp"
> >
</File> </File>
<File <File
RelativePath="..\bios.c" RelativePath="..\bios.cpp"
> >
</File> </File>
<File <File
RelativePath="..\cflash.c" RelativePath="..\cflash.cpp"
> >
</File> </File>
<File <File
@ -574,7 +574,7 @@
> >
</File> </File>
<File <File
RelativePath="..\cp15.c" RelativePath="..\cp15.cpp"
> >
</File> </File>
<File <File
@ -582,11 +582,11 @@
> >
</File> </File>
<File <File
RelativePath="..\debug.c" RelativePath="..\debug.cpp"
> >
</File> </File>
<File <File
RelativePath="..\Disassembler.c" RelativePath="..\Disassembler.cpp"
> >
</File> </File>
<File <File
@ -594,7 +594,7 @@
> >
</File> </File>
<File <File
RelativePath="..\FIFO.c" RelativePath="..\FIFO.cpp"
> >
</File> </File>
<File <File
@ -602,7 +602,7 @@
> >
</File> </File>
<File <File
RelativePath="..\fs-windows.c" RelativePath="..\fs-windows.cpp"
> >
</File> </File>
<File <File
@ -614,7 +614,7 @@
> >
</File> </File>
<File <File
RelativePath="..\GPU.c" RelativePath="..\GPU.cpp"
> >
</File> </File>
<File <File
@ -636,14 +636,6 @@
CompileAs="0" CompileAs="0"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Release (SSE2)|Win32"
>
<Tool
Name="VCCLCompilerTool"
CompileAs="0"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|x64" Name="Release|x64"
> >
@ -666,7 +658,7 @@
> >
</File> </File>
<File <File
RelativePath="..\matrix.c" RelativePath="..\matrix.cpp"
> >
</File> </File>
<File <File
@ -773,7 +765,7 @@
> >
</File> </File>
<File <File
RelativePath="..\mc.c" RelativePath="..\mc.cpp"
> >
</File> </File>
<File <File
@ -781,11 +773,11 @@
> >
</File> </File>
<File <File
RelativePath="..\MMU.c" RelativePath="..\MMU.cpp"
> >
</File> </File>
<File <File
RelativePath="..\NDSSystem.c" RelativePath="..\NDSSystem.cpp"
> >
</File> </File>
<File <File
@ -801,15 +793,15 @@
> >
</File> </File>
<File <File
RelativePath="..\render3D.c" RelativePath="..\render3D.cpp"
> >
</File> </File>
<File <File
RelativePath="..\ROMReader.c" RelativePath="..\ROMReader.cpp"
> >
</File> </File>
<File <File
RelativePath="..\saves.c" RelativePath="..\saves.cpp"
> >
</File> </File>
<File <File
@ -817,11 +809,11 @@
> >
</File> </File>
<File <File
RelativePath="..\SPU.c" RelativePath="..\SPU.cpp"
> >
</File> </File>
<File <File
RelativePath="..\thumb_instructions.c" RelativePath="..\thumb_instructions.cpp"
> >
</File> </File>
<File <File
@ -829,7 +821,7 @@
> >
</File> </File>
<File <File
RelativePath="..\wifi.c" RelativePath="..\wifi.cpp"
> >
</File> </File>
</Filter> </Filter>

View File

@ -1536,9 +1536,9 @@ __forceinline void NDS_glFlush(unsigned long v)
glBegin(type==3?GL_TRIANGLES:GL_QUADS); glBegin(type==3?GL_TRIANGLES:GL_QUADS);
for(j=0;j<type;j++) { for(j=0;j<type;j++) {
VERT* vert = &vertlist->list[poly->vertIndexes[j]]; VERT* vert = &vertlist->list[poly->vertIndexes[j]];
float tempCoord[4];
Vector4Copy(tempCoord,vert->coord);
//float tempCoord[4];
//Vector4Copy(tempCoord,vert->coord);
//we havent got the whole pipeline working yet, so we cant do this //we havent got the whole pipeline working yet, so we cant do this
////convert from ds device coords to opengl ////convert from ds device coords to opengl
//tempCoord[0] *= 2; //tempCoord[0] *= 2;
@ -1549,7 +1549,8 @@ __forceinline void NDS_glFlush(unsigned long v)
//todo - edge flag? //todo - edge flag?
glTexCoord2fv(vert->texcoord); glTexCoord2fv(vert->texcoord);
glColor4iv(vert->color); glColor4iv(vert->color);
glVertex3fv(tempCoord); //glVertex3fv(tempCoord);
glVertex3fv(vert->coord);
} }
glEnd(); glEnd();
} }

View File

@ -116,7 +116,6 @@ int sndcoretype=SNDCORE_DIRECTX;
int sndbuffersize=735*4; int sndbuffersize=735*4;
int sndvolume=100; int sndvolume=100;
extern "C" {
SoundInterface_struct *SNDCoreList[] = { SoundInterface_struct *SNDCoreList[] = {
&SNDDummy, &SNDDummy,
&SNDFile, &SNDFile,
@ -128,7 +127,6 @@ GPU3DInterface *core3DList[] = {
&gpu3DNull, &gpu3DNull,
&gpu3Dgl, &gpu3Dgl,
}; };
}
int autoframeskipenab=1; int autoframeskipenab=1;
int frameskiprate=0; int frameskiprate=0;
@ -659,7 +657,7 @@ BOOL LoadROM(char * filename, const char *cflash_disk_image)
/* /*
* The thread handling functions needed by the GDB stub code. * The thread handling functions needed by the GDB stub code.
*/ */
void * extern "C" void *
createThread_gdb( void (*thread_function)( void *data), createThread_gdb( void (*thread_function)( void *data),
void *thread_data) { void *thread_data) {
void *new_thread = CreateThread( NULL, 0, void *new_thread = CreateThread( NULL, 0,
@ -669,7 +667,7 @@ createThread_gdb( void (*thread_function)( void *data),
return new_thread; return new_thread;
} }
void extern "C" void
joinThread_gdb( void *thread_handle) { joinThread_gdb( void *thread_handle) {
} }