Applied patch by Colin McQuillan that fixes compilation

on Linux and remove warnings.
This commit is contained in:
yabause 2008-09-05 23:07:08 +00:00
parent 1287388bfa
commit 164ffb7a07
11 changed files with 62 additions and 55 deletions

View File

@ -276,7 +276,7 @@ void GPU_setVideoProp(GPU * gpu, u32 p)
struct _DISPCNT * cnt;
cnt = &(gpu->dispx_st)->dispx_DISPCNT.bits;
T1WriteLong(&(gpu->dispx_st)->dispx_DISPCNT.val, 0, p);
T1WriteLong((u8 *)&(gpu->dispx_st)->dispx_DISPCNT.val, 0, p);
gpu->WIN0_ENABLED = cnt->Win0_Enable;
gpu->WIN1_ENABLED = cnt->Win1_Enable;
@ -348,7 +348,7 @@ void GPU_setBGProp(GPU * gpu, u16 num, u16 p)
struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits;
int mode;
T1WriteWord(&(gpu->dispx_st)->dispx_BGxCNT[num].val, 0, p);
T1WriteWord((u8 *)&(gpu->dispx_st)->dispx_BGxCNT[num].val, 0, p);
GPU_resortBGs(gpu);
@ -720,7 +720,7 @@ INLINE void renderline_textBG(const GPU * gpu, u8 num, u8 * dst, u32 Y, u16 XBG,
u16 x = 0;
u16 xfin;
u16 palette_size;
u16 mosaic = T1ReadWord(&gpu->dispx_st->dispx_MISC.MOSAIC, 0);
u16 mosaic = T1ReadWord((u8 *)&gpu->dispx_st->dispx_MISC.MOSAIC, 0);
s8 line_dir = 1;
u8 pt_xor = 0;
@ -1060,7 +1060,7 @@ INLINE void extRotBG2(GPU * gpu, u8 num, u8 * dst, u16 H, s32 X, s32 Y, s16 PA,
void lineText(GPU * gpu, u8 num, u16 l, u8 * DST)
{
BGxOFS * ofs = &gpu->dispx_st->dispx_BGxOFS[num];
renderline_textBG(gpu, num, DST, l, T1ReadWord(&ofs->BGxHOFS, 0), l + T1ReadWord(&ofs->BGxVOFS, 0), 256);
renderline_textBG(gpu, num, DST, l, T1ReadWord((u8 *)&ofs->BGxHOFS, 0), l + T1ReadWord((u8 *)&ofs->BGxVOFS, 0), 256);
}
void lineRot(GPU * gpu, u8 num, u16 l, u8 * DST)

View File

@ -657,7 +657,7 @@ u16 FASTCALL MMU_read16(u32 proc, u32 adr)
return (gpu3D->NDS_3D_GetNumVertex()&8191);
case REG_IPCFIFORECV : /* TODO (clear): ??? */
printlog("Stopped IPCFIFORECV\n");
//printlog("Stopped IPCFIFORECV\n");
execute = FALSE;
return 1;

View File

@ -30,6 +30,7 @@
#include "MMU.h"
#include "cflash.h"
#include "ROMReader.h"
#include "render3D.h"
/* the count of bytes copied from the firmware into memory */
#define NDS_FW_USER_SETTINGS_MEM_BYTE_COUNT 0x70

View File

@ -173,14 +173,14 @@ ROMReader_struct ZIPROMReader =
void * ZIPROMReaderInit(const char * filename)
{
ZZIP_DIRENT * dir = zzip_opendir(filename);
dir = zzip_readdir(dir);
ZZIP_DIR * dir = zzip_opendir(filename);
ZZIP_DIRENT * dirent = zzip_readdir(dir);
if (dir != NULL)
{
char tmp1[1024];
char tmp2[1024];
strncpy(tmp1, filename, strlen(filename) - 4);
sprintf(tmp2, "%s/%s", tmp1, dir->d_name);
sprintf(tmp2, "%s/%s", tmp1, dirent->d_name);
return zzip_fopen(tmp2, "rb");
}
return NULL;

View File

@ -123,7 +123,7 @@ void set_joy_keys(const u16 joyCfg[])
}
/* Set all buttons at once */
void set_kb_keys(u16 kbCfg[])
void set_kb_keys(const u16 kbCfg[])
{
memcpy(keyboard_cfg, kbCfg, sizeof(keyboard_cfg));
}

View File

@ -81,7 +81,7 @@ void load_default_config( void);
BOOL init_joy( void);
void uninit_joy( void);
void set_joy_keys(const u16 joyCfg[]);
void set_kb_keys(u16 kbCfg[]);
void set_kb_keys(const u16 kbCfg[]);
u16 get_set_joy_key(int index);
void get_set_joy_axis(int index, int index_opp);
void update_keypad(u16 keys);

View File

@ -51,7 +51,7 @@ typedef struct
u8 bootCode[448];
u16 signature;
} fat16;
} BOOT_RECORD;
} __PACKED BOOT_RECORD;
#pragma pack(pop)
// Directory entry - must be packed
@ -71,59 +71,59 @@ typedef struct
u16 mDate;
u16 startCluster;
u32 fileSize;
} DIR_ENT;
} __PACKED DIR_ENT;
#pragma pack(pop)
#else
#define DIR_SEP "/"
typedef struct
{
u8 jmpBoot[3] __PACKED;
u8 OEMName[8] __PACKED;
u8 jmpBoot[3];
u8 OEMName[8];
// BIOS Parameter Block
u16 bytesPerSector __PACKED;
u8 sectorsPerCluster __PACKED;
u16 reservedSectors __PACKED;
u8 numFATs __PACKED;
u16 rootEntries __PACKED;
u16 numSectorsSmall __PACKED;
u8 mediaDesc __PACKED;
u16 sectorsPerFAT __PACKED;
u16 sectorsPerTrk __PACKED;
u16 numHeads __PACKED;
u32 numHiddenSectors __PACKED;
u32 numSectors __PACKED;
u16 bytesPerSector;
u8 sectorsPerCluster;
u16 reservedSectors;
u8 numFATs;
u16 rootEntries;
u16 numSectorsSmall;
u8 mediaDesc;
u16 sectorsPerFAT;
u16 sectorsPerTrk;
u16 numHeads;
u32 numHiddenSectors;
u32 numSectors;
struct
{
// Ext BIOS Parameter Block for FAT16
u8 driveNumber __PACKED;
u8 reserved1 __PACKED;
u8 extBootSig __PACKED;
u32 volumeID __PACKED;
u8 volumeLabel[11] __PACKED;
u8 fileSysType[8] __PACKED;
u8 driveNumber;
u8 reserved1;
u8 extBootSig;
u32 volumeID;
u8 volumeLabel[11];
u8 fileSysType[8];
// Bootcode
u8 bootCode[448] __PACKED;
u16 signature __PACKED;
u8 bootCode[448];
u16 signature;
} fat16;
} BOOT_RECORD;
} __PACKED BOOT_RECORD;
// Directory entry - must be packed
typedef struct
{
u8 name[NAME_LEN] __PACKED;
u8 ext[EXT_LEN] __PACKED;
u8 attrib __PACKED;
u8 reserved __PACKED;
u8 cTime_ms __PACKED;
u16 cTime __PACKED;
u16 cDate __PACKED;
u16 aDate __PACKED;
u16 startClusterHigh __PACKED;
u16 mTime __PACKED;
u16 mDate __PACKED;
u16 startCluster __PACKED;
u32 fileSize __PACKED;
} DIR_ENT;
u8 name[NAME_LEN];
u8 ext[EXT_LEN];
u8 attrib;
u8 reserved;
u8 cTime_ms;
u16 cTime;
u16 cDate;
u16 aDate;
u16 startClusterHigh;
u16 mTime;
u16 mDate;
u16 startCluster;
u32 fileSize;
} __PACKED DIR_ENT;
#endif
#endif

View File

@ -146,7 +146,7 @@ fill_configured_features( struct configured_features *config,
config->firmware_language = lang;
}
else {
g_print( stderr, _("Firmware language must be set to a value from 0 to 5.\n"));
g_printerr( _("Firmware language must be set to a value from 0 to 5.\n"));
good_args = 0;
}
}

View File

@ -1263,7 +1263,7 @@ return 1;
static void Printscreen()
{
WriteBMP("./test.bmp",GPU_screen);
WriteBMP("./test.bmp",(u16 *)GPU_screen);
}
/////////////////////////////// DS CONFIGURATION //////////////////////////////////
@ -1540,7 +1540,7 @@ gboolean EmuLoop(gpointer data)
*
* @return The interval to the next call (required by SDL)
*/
static u32 fps_limiter_fn(u32 interval, void *param) {
static Uint32 fps_limiter_fn(Uint32 interval, void *param) {
SDL_sem *sdl_semaphore = (SDL_sem *)param;
/* signal the semaphore if it is getting low */

View File

@ -3007,6 +3007,12 @@ GPU3DInterface gpu3D_opengl_collector = {
/* the Init function */
init_3Dgl_collect,
/* Reset */
nullFunc2_3Dgl_collect,
/* Close */
nullFunc2_3Dgl_collect,
/* Viewport */
viewport_3Dgl_collect,

View File

@ -87,9 +87,9 @@ GPU3DInterface gpu3DNull = {
NDS_nullFunc11, // NDS_glGetLightDirection
NDS_nullFunc11, // NDS_glGetLightColor
NDS_nullFunc8, // NDS_3D_BoxTest
NDS_nullFunc8, // NDS_3D_PosTest
NDS_nullFunc9, // NDS_3D_VecTest
NDS_nullFunc3, // NDS_3D_BoxTest
NDS_nullFunc3, // NDS_3D_PosTest
NDS_nullFunc3, // NDS_3D_VecTest
NDS_nullFunc8, // NDS_3D_GetPosRes
NDS_nullFunc8 // NDS_3D_GetVecRes