fix a bunch of warnings

This commit is contained in:
zeromus 2009-07-23 20:49:33 +00:00
parent c16bf09a68
commit acadc2f784
38 changed files with 341 additions and 350 deletions

View File

@ -21,12 +21,12 @@ Graphics:
bug: fix 256B granularity sprite addressing for sub gpu bug: fix 256B granularity sprite addressing for sub gpu
bug: fix 128-wide captures bug: fix 128-wide captures
bug: swrast: add clear image emulation bug: swrast: add clear image emulation
bug: swrast: add edge marking
Windows: Windows:
bug: improve map view tool to support more modes bug: improve map view tool to support more modes
enh: added 2x resizing filters (hq2x, 2xsai, supereagle, scanlines) enh: added 2x resizing filters (hq2x, 2xsai, supereagle, scanlines)
enh: soundview can now mute channels enh: soundview can now mute channels
enh: multicore optimization for filters, rotation, OSD
Linux: Linux:
enh: alsa microphone support enh: alsa microphone support

View File

@ -874,8 +874,9 @@ void GPU_addBack(GPU * gpu, u8 num)
/*****************************************************************************/ /*****************************************************************************/
template<int WIN_NUM> template<int WIN_NUM>
FORCEINLINE bool GPU::withinRect(u8 x) const FORCEINLINE u8 GPU::withinRect(u16 x) const
{ {
assert(x<256); //only way to be >256 is in debug views, and mosaic shouldnt be enabled for those
return curr_win[WIN_NUM][x]; return curr_win[WIN_NUM][x];
} }
@ -1140,7 +1141,7 @@ finish:
static void mosaicSpriteLinePixel(GPU * gpu, int x, u16 l, u8 * dst, u8 * dst_alpha, u8 * typeTab, u8 * prioTab) static void mosaicSpriteLinePixel(GPU * gpu, int x, u16 l, u8 * dst, u8 * dst_alpha, u8 * typeTab, u8 * prioTab)
{ {
int x_int; int x_int;
u8 y = l; int y = l;
_OAM_ * spriteInfo = (_OAM_ *)(gpu->oam + gpu->sprNum[x]); _OAM_ * spriteInfo = (_OAM_ *)(gpu->oam + gpu->sprNum[x]);
bool enabled = spriteInfo->Mosaic; bool enabled = spriteInfo->Mosaic;
@ -1459,7 +1460,7 @@ template<bool MOSAIC> FORCEINLINE void extRotBG2(GPU * gpu, s32 X, s32 Y, s16 PA
u8 num = gpu->currBgNum; u8 num = gpu->currBgNum;
struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits; struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits;
u8 *map, *tile, *pal; u8 *pal;
switch(gpu->BGTypes[num]) switch(gpu->BGTypes[num])
{ {
@ -1785,7 +1786,7 @@ void GPU::_spriteRender(u8 * dst, u8 * dst_alpha, u8 * typeTab, u8 * prioTab)
struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits; struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits;
_OAM_ * spriteInfo = (_OAM_ *)(gpu->oam + (nbShow-1));// + 127; _OAM_ * spriteInfo = (_OAM_ *)(gpu->oam + (nbShow-1));// + 127;
u8 block = gpu->sprBoundary; u8 block = gpu->sprBoundary;
u16 i; u8 i;
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
*(((u16*)spriteInfo)+1) = (*(((u16*)spriteInfo)+1) >> 1) | *(((u16*)spriteInfo)+1) << 15; *(((u16*)spriteInfo)+1) = (*(((u16*)spriteInfo)+1) >> 1) | *(((u16*)spriteInfo)+1) << 15;
@ -2370,7 +2371,7 @@ static void GPU_ligne_layer(NDS_Screen * screen, u16 l)
BG_enabled = FALSE; BG_enabled = FALSE;
for(int j=0;j<8;j++) for(int j=0;j<8;j++)
gpu->blend2[j] = (gpu->BLDCNT & (0x100 << j)); gpu->blend2[j] = (gpu->BLDCNT & (0x100 << j))!=0;
// paint lower priorities fist // paint lower priorities fist
// then higher priorities on top // then higher priorities on top
@ -2386,8 +2387,8 @@ static void GPU_ligne_layer(NDS_Screen * screen, u16 l)
i16 = item->BGs[i]; i16 = item->BGs[i];
if (gpu->LayersEnable[i16]) if (gpu->LayersEnable[i16])
{ {
gpu->currBgNum = i16; gpu->currBgNum = (u8)i16;
gpu->blend1 = gpu->BLDCNT & (1 << gpu->currBgNum); gpu->blend1 = (gpu->BLDCNT & (1 << gpu->currBgNum))!=0;
struct _BGxCNT *bgCnt = &(gpu->dispx_st)->dispx_BGxCNT[i16].bits; struct _BGxCNT *bgCnt = &(gpu->dispx_st)->dispx_BGxCNT[i16].bits;
gpu->curr_mosaic_enabled = bgCnt->Mosaic_Enable; gpu->curr_mosaic_enabled = bgCnt->Mosaic_Enable;
@ -2433,7 +2434,7 @@ static void GPU_ligne_layer(NDS_Screen * screen, u16 l)
if (gpu->LayersEnable[4]) if (gpu->LayersEnable[4])
{ {
gpu->currBgNum = 4; gpu->currBgNum = 4;
gpu->blend1 = gpu->BLDCNT & (1 << gpu->currBgNum); gpu->blend1 = (gpu->BLDCNT & (1 << gpu->currBgNum))!=0;
for (int i=0; i < item->nbPixelsX; i++) for (int i=0; i < item->nbPixelsX; i++)
{ {

View File

@ -716,14 +716,14 @@ struct GPU
u8 WIN1V1; u8 WIN1V1;
u8 WININ0; u8 WININ0;
u8 WININ0_SPECIAL; bool WININ0_SPECIAL;
u8 WININ1; u8 WININ1;
u8 WININ1_SPECIAL; bool WININ1_SPECIAL;
u8 WINOUT; u8 WINOUT;
u8 WINOUT_SPECIAL; bool WINOUT_SPECIAL;
u8 WINOBJ; u8 WINOBJ;
u8 WINOBJ_SPECIAL; bool WINOBJ_SPECIAL;
u8 WIN0_ENABLED; u8 WIN0_ENABLED;
u8 WIN1_ENABLED; u8 WIN1_ENABLED;
@ -836,7 +836,7 @@ struct GPU
// check whether (x,y) is within the rectangle (including wraparounds) // check whether (x,y) is within the rectangle (including wraparounds)
template<int WIN_NUM> template<int WIN_NUM>
bool withinRect(u8 x) const; u8 withinRect(u16 x) const;
void setBLDALPHA(u16 val) void setBLDALPHA(u16 val)
{ {
@ -974,9 +974,9 @@ inline void GPU_setWIN1_V1(GPU* gpu, u8 val) { gpu->WIN1V1 = val; }
inline void GPU_setWININ(GPU* gpu, u16 val) { inline void GPU_setWININ(GPU* gpu, u16 val) {
gpu->WININ0=val&0x1F; gpu->WININ0=val&0x1F;
gpu->WININ0_SPECIAL=(val>>5)&1; gpu->WININ0_SPECIAL=((val>>5)&1)!=0;
gpu->WININ1=(val>>8)&0x1F; gpu->WININ1=(val>>8)&0x1F;
gpu->WININ1_SPECIAL=(val>>13)&1; gpu->WININ1_SPECIAL=((val>>13)&1)!=0;
} }
inline void GPU_setWININ0(GPU* gpu, u8 val) { gpu->WININ0 = val&0x1F; gpu->WININ0_SPECIAL = (val>>5)&1; } inline void GPU_setWININ0(GPU* gpu, u8 val) { gpu->WININ0 = val&0x1F; gpu->WININ0_SPECIAL = (val>>5)&1; }
@ -984,9 +984,9 @@ inline void GPU_setWININ1(GPU* gpu, u8 val) { gpu->WININ1 = val&0x1F; gpu->WININ
inline void GPU_setWINOUT16(GPU* gpu, u16 val) { inline void GPU_setWINOUT16(GPU* gpu, u16 val) {
gpu->WINOUT=val&0x1F; gpu->WINOUT=val&0x1F;
gpu->WINOUT_SPECIAL=(val>>5)&1; gpu->WINOUT_SPECIAL=((val>>5)&1)!=0;
gpu->WINOBJ=(val>>8)&0x1F; gpu->WINOBJ=(val>>8)&0x1F;
gpu->WINOBJ_SPECIAL=(val>>13)&1; gpu->WINOBJ_SPECIAL=((val>>13)&1)!=0;
} }
inline void GPU_setWINOUT(GPU* gpu, u8 val) { gpu->WINOUT = val&0x1F; gpu->WINOUT_SPECIAL = (val>>5)&1; } inline void GPU_setWINOUT(GPU* gpu, u8 val) { gpu->WINOUT = val&0x1F; gpu->WINOUT_SPECIAL = (val>>5)&1; }
inline void GPU_setWINOBJ(GPU* gpu, u8 val) { gpu->WINOBJ = val&0x1F; gpu->WINOBJ_SPECIAL = (val>>5)&1; } inline void GPU_setWINOBJ(GPU* gpu, u8 val) { gpu->WINOBJ = val&0x1F; gpu->WINOBJ_SPECIAL = (val>>5)&1; }

View File

@ -992,10 +992,10 @@ static void execsqrt() {
if (cnt&1) { if (cnt&1) {
u64 v = T1ReadQuad(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x2B8); u64 v = T1ReadQuad(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x2B8);
ret = isqrt(v); ret = (u32)isqrt(v);
} else { } else {
u32 v = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x2B8); u32 v = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x2B8);
ret = isqrt(v); ret = (u32)isqrt(v);
} }
T1WriteLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x2B4, 0); T1WriteLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x2B4, 0);
T1WriteLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x2B0, cnt | 0x8000); T1WriteLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x2B0, cnt | 0x8000);

View File

@ -289,7 +289,7 @@ u16 FASTCALL _MMU_ARM7_read16(u32 adr);
u32 FASTCALL _MMU_ARM7_read32(u32 adr); u32 FASTCALL _MMU_ARM7_read32(u32 adr);
extern u32 _MMU_MAIN_MEM_MASK; extern u32 _MMU_MAIN_MEM_MASK;
inline void SetupMMU(bool debugConsole) { inline void SetupMMU(BOOL debugConsole) {
if(debugConsole) _MMU_MAIN_MEM_MASK = 0x7FFFFF; if(debugConsole) _MMU_MAIN_MEM_MASK = 0x7FFFFF;
else _MMU_MAIN_MEM_MASK = 0x3FFFFF; else _MMU_MAIN_MEM_MASK = 0x3FFFFF;
} }

View File

@ -1194,7 +1194,7 @@ int NDS_WriteBMP(const char *filename)
pixel-=r<<10; pixel-=r<<10;
g = pixel>>5; g = pixel>>5;
pixel-=g<<5; pixel-=g<<5;
b = pixel; b = (u8)pixel;
r*=255/31; r*=255/31;
g*=255/31; g*=255/31;
b*=255/31; b*=255/31;
@ -2352,12 +2352,12 @@ void NDS_Reset()
if((CommonSettings.UseExtBIOS == true) && (CommonSettings.UseExtFirmware == true) && (CommonSettings.BootFromFirmware == true) && (fw_success == TRUE)) if((CommonSettings.UseExtBIOS == true) && (CommonSettings.UseExtFirmware == true) && (CommonSettings.BootFromFirmware == true) && (fw_success == TRUE))
{ {
for(int i = 0; i < nds.FW_ARM9BootCodeSize; i += 4) for(u32 i = 0; i < nds.FW_ARM9BootCodeSize; i += 4)
{ {
_MMU_write32<ARMCPU_ARM9>((nds.FW_ARM9BootCodeAddr + i), T1ReadLong(nds.FW_ARM9BootCode, i)); _MMU_write32<ARMCPU_ARM9>((nds.FW_ARM9BootCodeAddr + i), T1ReadLong(nds.FW_ARM9BootCode, i));
} }
for(int i = 0; i < nds.FW_ARM7BootCodeSize; i += 4) for(u32 i = 0; i < nds.FW_ARM7BootCodeSize; i += 4)
{ {
_MMU_write32<ARMCPU_ARM7>((nds.FW_ARM7BootCodeAddr + i), T1ReadLong(nds.FW_ARM7BootCode, i)); _MMU_write32<ARMCPU_ARM7>((nds.FW_ARM7BootCodeAddr + i), T1ReadLong(nds.FW_ARM7BootCode, i));
} }
@ -2372,7 +2372,7 @@ void NDS_Reset()
src = header->ARM9src; src = header->ARM9src;
dst = header->ARM9cpy; dst = header->ARM9cpy;
for(int i = 0; i < (header->ARM9binSize>>2); ++i) for(u32 i = 0; i < (header->ARM9binSize>>2); ++i)
{ {
_MMU_write32<ARMCPU_ARM9>(dst, T1ReadLong(MMU.CART_ROM, src)); _MMU_write32<ARMCPU_ARM9>(dst, T1ReadLong(MMU.CART_ROM, src));
dst += 4; dst += 4;
@ -2382,7 +2382,7 @@ void NDS_Reset()
src = header->ARM7src; src = header->ARM7src;
dst = header->ARM7cpy; dst = header->ARM7cpy;
for(int i = 0; i < (header->ARM7binSize>>2); ++i) for(u32 i = 0; i < (header->ARM7binSize>>2); ++i)
{ {
_MMU_write32<ARMCPU_ARM7>(dst, T1ReadLong(MMU.CART_ROM, src)); _MMU_write32<ARMCPU_ARM7>(dst, T1ReadLong(MMU.CART_ROM, src));
dst += 4; dst += 4;

View File

@ -98,7 +98,7 @@ extern autohold AutoHold;
int NDS_WritePNG(const char *fname); int NDS_WritePNG(const char *fname);
extern volatile BOOL execute; extern volatile bool execute;
extern BOOL click; extern BOOL click;
/* /*

View File

@ -31,7 +31,7 @@
#define cpu (&ARMPROC) #define cpu (&ARMPROC)
#define TEMPLATE template<int PROCNUM> #define TEMPLATE template<int PROCNUM>
extern volatile BOOL execute; extern volatile bool execute;
#define LSL_IMM shift_op = cpu->R[REG_POS(i,0)]<<((i>>7)&0x1F); #define LSL_IMM shift_op = cpu->R[REG_POS(i,0)]<<((i>>7)&0x1F);

View File

@ -393,7 +393,7 @@ static void cheats_ARparser(CHEATS_LIST cheat)
static BOOL cheatsXXcodePreparser(CHEATS_LIST *cheat, char *code) static BOOL cheatsXXcodePreparser(CHEATS_LIST *cheat, char *code)
{ {
u16 count = 0; int count = 0;
u16 t = 0; u16 t = 0;
char tmp_buf[sizeof(cheat->hi)+sizeof(cheat->lo)]; char tmp_buf[sizeof(cheat->hi)+sizeof(cheat->lo)];

View File

@ -36,7 +36,7 @@ typedef struct
u32 hi[255]; u32 hi[255];
u32 lo[255]; u32 lo[255];
char description[75]; char description[75];
u8 num; int num;
u8 size; u8 size;
} CHEATS_LIST; } CHEATS_LIST;

View File

@ -57,7 +57,7 @@
#include "../gdbstub.h" #include "../gdbstub.h"
#endif #endif
volatile BOOL execute = FALSE; volatile bool execute = false;
static float nds_screen_size_ratio = 1.0f; static float nds_screen_size_ratio = 1.0f;
@ -829,7 +829,7 @@ int main(int argc, char ** argv) {
} }
#endif #endif
execute = TRUE; execute = true;
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1) if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1)
{ {

View File

@ -42,7 +42,7 @@ char IniName[MAX_PATH];
void GetINIPath() void GetINIPath()
{ {
char vPath[MAX_PATH], *szPath, currDir[MAX_PATH]; char vPath[MAX_PATH], *szPath;
/*if (*vPath) /*if (*vPath)
szPath = vPath; szPath = vPath;
else else

View File

@ -66,7 +66,7 @@ extern u8 gba_header_data_0x04[156];
extern HINSTANCE hAppInst; extern HINSTANCE hAppInst;
extern BOOL romloaded; extern bool romloaded;
extern char IniName[MAX_PATH]; extern char IniName[MAX_PATH];
extern void GetINIPath(); extern void GetINIPath();

View File

@ -29,7 +29,7 @@ static BOOL regMainLoop = FALSE;
static BOOL noticed_3D=FALSE; static BOOL noticed_3D=FALSE;
volatile BOOL execute = FALSE; volatile bool execute = false;
BOOL click = FALSE; BOOL click = FALSE;
void desmume_mem_init(); void desmume_mem_init();
@ -49,12 +49,12 @@ void desmume_init( struct armcpu_memory_iface *arm9_mem_if,
NDS_Init(); NDS_Init();
#endif #endif
SPU_ChangeSoundCore(SNDCORE_SDL, 735 * 4); SPU_ChangeSoundCore(SNDCORE_SDL, 735 * 4);
execute = FALSE; execute = false;
} }
void desmume_free() void desmume_free()
{ {
execute = FALSE; execute = false;
NDS_DeInit(); NDS_DeInit();
} }
@ -74,14 +74,14 @@ void desmume_savetype(int type) {
void desmume_pause() void desmume_pause()
{ {
execute = FALSE; execute = false;
SPU_Pause(1); SPU_Pause(1);
} }
void desmume_resume() void desmume_resume()
{ {
SPU_Pause(0); SPU_Pause(0);
execute = TRUE; execute = true;
if(!regMainLoop) if(!regMainLoop)
g_idle_add_full(EMULOOP_PRIO, &EmuLoop, NULL, NULL); g_idle_add_full(EMULOOP_PRIO, &EmuLoop, NULL, NULL);
regMainLoop = TRUE; regMainLoop = TRUE;
@ -96,7 +96,7 @@ void desmume_reset()
void desmume_toggle() void desmume_toggle()
{ {
execute = (execute) ? FALSE : TRUE; execute ^= true;
} }
/*INLINE BOOL desmume_running() /*INLINE BOOL desmume_running()
{ {

View File

@ -27,7 +27,7 @@
#include "desmume.h" #include "desmume.h"
#include "movie.h" #include "movie.h"
volatile BOOL execute = FALSE; volatile bool execute = false;
BOOL click = FALSE; BOOL click = FALSE;
void desmume_init( struct armcpu_memory_iface *arm9_mem_if, void desmume_init( struct armcpu_memory_iface *arm9_mem_if,
@ -45,30 +45,30 @@ void desmume_init( struct armcpu_memory_iface *arm9_mem_if,
if ( !disable_sound) { if ( !disable_sound) {
SPU_ChangeSoundCore(SNDCORE_SDL, 735 * 4); SPU_ChangeSoundCore(SNDCORE_SDL, 735 * 4);
} }
execute = FALSE; execute = false;
} }
void desmume_free( void) void desmume_free( void)
{ {
execute = FALSE; execute = false;
NDS_DeInit(); NDS_DeInit();
} }
void desmume_pause( void) void desmume_pause( void)
{ {
execute = FALSE; execute = false;
SPU_Pause(1); SPU_Pause(1);
} }
void desmume_resume( void) void desmume_resume( void)
{ {
execute = TRUE; execute = true;
SPU_Pause(0); SPU_Pause(0);
} }
void desmume_toggle( void) void desmume_toggle( void)
{ {
execute = (execute) ? FALSE : TRUE; execute ^= true;
} }
BOOL desmume_running( void) bool desmume_running( void)
{ {
return execute; return execute;
} }

View File

@ -32,7 +32,7 @@ extern void desmume_free( void);
extern void desmume_pause( void); extern void desmume_pause( void);
extern void desmume_resume( void); extern void desmume_resume( void);
extern void desmume_toggle( void); extern void desmume_toggle( void);
extern BOOL desmume_running( void); extern bool desmume_running( void);
extern void desmume_cycle( void); extern void desmume_cycle( void);

View File

@ -2859,8 +2859,7 @@ DEFINE_LUA_FUNCTION(movie_getlength, "")
} }
DEFINE_LUA_FUNCTION(movie_isactive, "") DEFINE_LUA_FUNCTION(movie_isactive, "")
{ {
if(movieMode != MOVIEMODE_INACTIVE); lua_pushboolean(L, movieMode != MOVIEMODE_INACTIVE);
lua_pushboolean(L, true);
return 1; return 1;
} }
DEFINE_LUA_FUNCTION(movie_rerecordcount, "") DEFINE_LUA_FUNCTION(movie_rerecordcount, "")

View File

@ -128,7 +128,7 @@ public:
ReadKey(pathToLua, LUAKEY); ReadKey(pathToLua, LUAKEY);
#ifdef WIN32 #ifdef WIN32
GetPrivateProfileString(SECTION, FORMATKEY, "%f_%s_%r", screenshotFormat, MAX_FORMAT, IniName); GetPrivateProfileString(SECTION, FORMATKEY, "%f_%s_%r", screenshotFormat, MAX_FORMAT, IniName);
savelastromvisit = GetPrivateProfileInt(SECTION, LASTVISITKEY, TRUE, IniName); savelastromvisit = GetPrivateProfileBool(SECTION, LASTVISITKEY, true, IniName);
currentimageformat = (ImageFormat)GetPrivateProfileInt(SECTION, DEFAULTFORMATKEY, PNG, IniName); currentimageformat = (ImageFormat)GetPrivateProfileInt(SECTION, DEFAULTFORMATKEY, PNG, IniName);
#endif #endif
/* /*
@ -252,7 +252,7 @@ public:
std::string file; std::string file;
time_t now = time(NULL); time_t now = time(NULL);
tm *time_struct = localtime(&now); tm *time_struct = localtime(&now);
srand(now); srand((unsigned int)now);
for(int i = 0; i < MAX_FORMAT;i++) for(int i = 0; i < MAX_FORMAT;i++)
{ {

View File

@ -647,7 +647,7 @@ FORCEINLINE fixed28_4 FloatToFixed28_4( float Value ) {
return (fixed28_4)(Value * 16); return (fixed28_4)(Value * 16);
} }
FORCEINLINE float Fixed28_4ToFloat( fixed28_4 Value ) { FORCEINLINE float Fixed28_4ToFloat( fixed28_4 Value ) {
return Value / 16.0; return Value / 16.0f;
} }
//inline fixed16_16 FloatToFixed16_16( float Value ) { //inline fixed16_16 FloatToFixed16_16( float Value ) {
// return (fixed16_6)(Value * 65536); // return (fixed16_6)(Value * 65536);
@ -965,50 +965,50 @@ static void SoftRastVramReconfigureSignal() {
static void SoftRastFramebufferProcess() static void SoftRastFramebufferProcess()
{ {
//this is not very accurate, but it works roughly //this is not very accurate. taking it out for now
if(gfx3d.enableEdgeMarking) //if(gfx3d.enableEdgeMarking)
{ //{
u8 clearPolyid = ((gfx3d.clearColor>>24)&0x3F)>>3; // u8 clearPolyid = ((gfx3d.clearColor>>24)&0x3F)>>3;
//TODO - need to test and find out whether these get grabbed at flush time, or at render time // //TODO - need to test and find out whether these get grabbed at flush time, or at render time
//we can do this by rendering a 3d frame and then freezing the system, but only changing the edge mark colors // //we can do this by rendering a 3d frame and then freezing the system, but only changing the edge mark colors
//now, I am not entirely sure about this. I can't find any documentation about the high bit here but // //now, I am not entirely sure about this. I can't find any documentation about the high bit here but
//it doesnt seem plausible to me that its all or nothing. I think that only polyid groups with a color // //it doesnt seem plausible to me that its all or nothing. I think that only polyid groups with a color
//with the high bit set get edge marked. // //with the high bit set get edge marked.
u16 edgeMarkColors[8]; // u16 edgeMarkColors[8];
bool edgeMarkEnables[8]; // bool edgeMarkEnables[8];
for(int i=0;i<8;i++) // for(int i=0;i<8;i++)
{ // {
edgeMarkColors[i] = T1ReadWord(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x330+i*2); // edgeMarkColors[i] = T1ReadWord(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x330+i*2);
edgeMarkEnables[i] = (edgeMarkColors[i]&0x8000)!=0; // edgeMarkEnables[i] = (edgeMarkColors[i]&0x8000)!=0;
} // }
for(int i=0,y=0;y<192;y++) // for(int i=0,y=0;y<192;y++)
{ // {
for(int x=0;x<256;x++,i++) // for(int x=0;x<256;x++,i++)
{ // {
Fragment &destFragment = screen[i]; // Fragment &destFragment = screen[i];
FragmentColor &destFragmentColor = screenColor[i]; // FragmentColor &destFragmentColor = screenColor[i];
u8 self = destFragment.polyid.opaque>>3; // u8 self = destFragment.polyid.opaque>>3;
if(!edgeMarkEnables[self]) continue; // if(!edgeMarkEnables[self]) continue;
if(destFragment.isTranslucentPoly) continue; // if(destFragment.isTranslucentPoly) continue;
u8 left = x==0?clearPolyid:(screen[i-1].polyid.opaque>>3); // u8 left = x==0?clearPolyid:(screen[i-1].polyid.opaque>>3);
u8 right = x==255?clearPolyid:(screen[i+1].polyid.opaque>>3); // u8 right = x==255?clearPolyid:(screen[i+1].polyid.opaque>>3);
u8 top = y==0?clearPolyid:(screen[i-256].polyid.opaque>>3); // u8 top = y==0?clearPolyid:(screen[i-256].polyid.opaque>>3);
u8 bottom = y==191?clearPolyid:(screen[i+256].polyid.opaque>>3); // u8 bottom = y==191?clearPolyid:(screen[i+256].polyid.opaque>>3);
if(left != self || right != self || top != self || bottom != self) // if(left != self || right != self || top != self || bottom != self)
{ // {
destFragmentColor.color = edgeMarkColors[self]; // destFragmentColor.color = edgeMarkColors[self];
} // }
//
// }
// }
} //}
}
}
} }

View File

@ -47,8 +47,8 @@ int read8le(u8 *Bufo, std::istream *is)
int write16le(u16 b, FILE *fp) int write16le(u16 b, FILE *fp)
{ {
u8 s[2]; u8 s[2];
s[0]=b; s[0]=(u8)b;
s[1]=b>>8; s[1]=(u8)(b>>8);
return((fwrite(s,1,2,fp)<2)?0:2); return((fwrite(s,1,2,fp)<2)?0:2);
} }
@ -57,8 +57,8 @@ int write16le(u16 b, FILE *fp)
int write16le(u16 b, std::ostream *os) int write16le(u16 b, std::ostream *os)
{ {
u8 s[2]; u8 s[2];
s[0]=b; s[0]=(u8)b;
s[1]=b>>8; s[1]=(u8)(b>>8);
os->write((char*)&s,2); os->write((char*)&s,2);
return 2; return 2;
} }
@ -67,20 +67,20 @@ int write16le(u16 b, std::ostream *os)
int write32le(u32 b, FILE *fp) int write32le(u32 b, FILE *fp)
{ {
u8 s[4]; u8 s[4];
s[0]=b; s[0]=(u8)b;
s[1]=b>>8; s[1]=(u8)(b>>8);
s[2]=b>>16; s[2]=(u8)(b>>16);
s[3]=b>>24; s[3]=(u8)(b>>24);
return((fwrite(s,1,4,fp)<4)?0:4); return((fwrite(s,1,4,fp)<4)?0:4);
} }
int write32le(u32 b, std::ostream* os) int write32le(u32 b, std::ostream* os)
{ {
u8 s[4]; u8 s[4];
s[0]=b; s[0]=(u8)b;
s[1]=b>>8; s[1]=(u8)(b>>8);
s[2]=b>>16; s[2]=(u8)(b>>16);
s[3]=b>>24; s[3]=(u8)(b>>24);
os->write((char*)&s,4); os->write((char*)&s,4);
return 4; return 4;
} }
@ -90,14 +90,14 @@ void writebool(bool b, std::ostream* os) { write32le(b?1:0,os); }
int write64le(u64 b, std::ostream* os) int write64le(u64 b, std::ostream* os)
{ {
u8 s[8]; u8 s[8];
s[0]=b; s[0]=(u8)b;
s[1]=b>>8; s[1]=(u8)(b>>8);
s[2]=b>>16; s[2]=(u8)(b>>16);
s[3]=b>>24; s[3]=(u8)(b>>24);
s[4]=b>>32; s[4]=(u8)(b>>32);
s[5]=b>>40; s[5]=(u8)(b>>40);
s[6]=b>>48; s[6]=(u8)(b>>48);
s[7]=b>>56; s[7]=(u8)(b>>56);
os->write((char*)&s,8); os->write((char*)&s,8);
return 8; return 8;
} }
@ -161,7 +161,7 @@ int readbool(bool *b, std::istream* is)
{ {
u32 temp; u32 temp;
int ret = read32le(&temp,is); int ret = read32le(&temp,is);
*b = (bool)temp; *b = temp!=0;
return ret; return ret;
} }

View File

@ -89,7 +89,6 @@ void InitMovieTime(void)
movie.weekday=4; movie.weekday=4;
} }
#ifdef WIN32
static void MovieTime(void) { static void MovieTime(void) {
//now, you might think it is silly to go through all these conniptions //now, you might think it is silly to go through all these conniptions
@ -102,21 +101,16 @@ static void MovieTime(void) {
u64 frameCycles = (u64)arm9rate_unitsperframe * currFrameCounter; u64 frameCycles = (u64)arm9rate_unitsperframe * currFrameCounter;
u64 totalcycles = frameCycles + noon; u64 totalcycles = frameCycles + noon;
u32 totalseconds=totalcycles/arm9rate_unitspersecond; u64 totalseconds=totalcycles/arm9rate_unitspersecond;
movie.sec=totalseconds % 60; movie.sec=(int)(totalseconds % 60);
movie.minute=totalseconds/60; movie.minute=(int)(totalseconds/60);
movie.hour=movie.minute/60; movie.hour=movie.minute/60;
//convert to sane numbers //convert to sane numbers
movie.minute=movie.minute % 60; movie.minute=movie.minute % 60;
movie.hour=movie.hour % 24; movie.hour=movie.hour % 24;
} }
#else
static void MovieTime(void)
{
}
#endif
static void rtcRecv() static void rtcRecv()
{ {

View File

@ -1015,7 +1015,7 @@ void rewindsave () {
rewindbuffer.push_back(ms); rewindbuffer.push_back(ms);
if(rewindbuffer.size() > rewindstates) { if((int)rewindbuffer.size() > rewindstates) {
delete *rewindbuffer.begin(); delete *rewindbuffer.begin();
rewindbuffer.erase(rewindbuffer.begin()); rewindbuffer.erase(rewindbuffer.begin());
} }

View File

@ -586,7 +586,7 @@ REJECT:
for(int j=0;j<ms.numItems;j++) { for(int j=0;j<ms.numItems;j++) {
u16* map = (u16*)ms.items[j].ptr; u16* map = (u16*)ms.items[j].ptr;
int len = ms.items[j].len>>1; int len = ms.items[j].len>>1;
for(u32 x = 0; x < len; ++x) for(int x = 0; x < len; ++x)
{ {
u16 c = map[x]; u16 c = map[x];
int alpha = ((c&0x8000)?opaqueColor:0); int alpha = ((c&0x8000)?opaqueColor:0);

View File

@ -35,7 +35,7 @@
#define REG_NUM(i, n) (((i)>>n)&0x7) #define REG_NUM(i, n) (((i)>>n)&0x7)
extern volatile BOOL execute; extern volatile bool execute;
TEMPLATE static u32 FASTCALL OP_UND_THUMB() TEMPLATE static u32 FASTCALL OP_UND_THUMB()
{ {

View File

@ -286,16 +286,16 @@ inline float u32_to_float(u32 u) {
///stores a 32bit value into the provided byte array in guaranteed little endian form ///stores a 32bit value into the provided byte array in guaranteed little endian form
inline void en32lsb(u8 *buf, u32 morp) inline void en32lsb(u8 *buf, u32 morp)
{ {
buf[0]=morp; buf[0]=(u8)(morp);
buf[1]=morp>>8; buf[1]=(u8)(morp>>8);
buf[2]=morp>>16; buf[2]=(u8)(morp>>16);
buf[3]=morp>>24; buf[3]=(u8)(morp>>24);
} }
inline void en16lsb(u8* buf, u16 morp) inline void en16lsb(u8* buf, u16 morp)
{ {
buf[0]=morp; buf[0]=(u8)morp;
buf[1]=morp>>8; buf[1]=(u8)(morp>>8);
} }
///unpacks a 64bit little endian value from the provided byte array into host byte order ///unpacks a 64bit little endian value from the provided byte array into host byte order

View File

@ -61,9 +61,9 @@ void Desmume_Guid::scan(std::string& str)
{ {
char* endptr = (char*)str.c_str(); char* endptr = (char*)str.c_str();
en32lsb(data,strtoul(endptr,&endptr,16)); en32lsb(data,strtoul(endptr,&endptr,16));
en16lsb(data+4,strtoul(endptr+1,&endptr,16)); en16lsb(data+4,(u16)strtoul(endptr+1,&endptr,16));
en16lsb(data+6,strtoul(endptr+1,&endptr,16)); en16lsb(data+6,(u16)strtoul(endptr+1,&endptr,16));
en16lsb(data+8,strtoul(endptr+1,&endptr,16)); en16lsb(data+8,(u16)strtoul(endptr+1,&endptr,16));
endptr++; endptr++;
for(int i=0;i<6;i++) for(int i=0;i<6;i++)
data[10+i] = hexToByte(&endptr); data[10+i] = hexToByte(&endptr);

View File

@ -62,12 +62,12 @@ bool WINCLASS::createEx(LPSTR caption, int x, int y, int width, int height, int
bool WINCLASS::setMenu(HMENU menu) bool WINCLASS::setMenu(HMENU menu)
{ {
hmenu = menu; hmenu = menu;
return SetMenu(hwnd, hmenu); return SetMenu(hwnd, hmenu)==TRUE;
} }
DWORD WINCLASS::checkMenu(UINT idd, UINT check) DWORD WINCLASS::checkMenu(UINT idd, bool check)
{ {
return CheckMenuItem(hmenu, idd, check); return CheckMenuItem(hmenu, idd, MF_BYCOMMAND | (check?MF_CHECKED:MF_UNCHECKED));
} }
HWND WINCLASS::getHWnd() HWND WINCLASS::getHWnd()

View File

@ -42,7 +42,7 @@ public:
HMENU menu); HMENU menu);
bool setMenu(HMENU menu); bool setMenu(HMENU menu);
DWORD checkMenu(UINT idd, UINT check); DWORD checkMenu(UINT idd, bool check);
void Show(int mode); void Show(int mode);
void Hide(); void Hide();

View File

@ -102,7 +102,7 @@ LRESULT DisViewBox_OnPaint(HWND hwnd, disview_struct *win, WPARAM wParam, LPARAM
if(((win->cpu->instruct_adr&0x0FFFFFFF) >= win->curr_ligne<<2)&&((win->cpu->instruct_adr&0x0FFFFFFF) <= (win->curr_ligne+nbligne<<2))) if(((win->cpu->instruct_adr&0x0FFFFFFF) >= (win->curr_ligne<<2))&&((win->cpu->instruct_adr&0x0FFFFFFF) <= (win->curr_ligne+(nbligne<<2))))
{ {
HBRUSH brjaune = CreateSolidBrush(RGB(255, 255, 0)); HBRUSH brjaune = CreateSolidBrush(RGB(255, 255, 0));
SetBkColor(mem_dc, RGB(255, 255, 0)); SetBkColor(mem_dc, RGB(255, 255, 0));
@ -134,7 +134,7 @@ LRESULT DisViewBox_OnPaint(HWND hwnd, disview_struct *win, WPARAM wParam, LPARAM
adr += 2; adr += 2;
} }
if(((win->cpu->instruct_adr&0x0FFFFFFF) >= win->curr_ligne<<1)&&((win->cpu->instruct_adr&0x0FFFFFFF) <= (win->curr_ligne+nbligne<<1))) if(((win->cpu->instruct_adr&0x0FFFFFFF) >= (win->curr_ligne<<1))&&((win->cpu->instruct_adr&0x0FFFFFFF) <= (win->curr_ligne+(nbligne<<1))))
{ {
HBRUSH brjaune = CreateSolidBrush(RGB(255, 255, 0)); HBRUSH brjaune = CreateSolidBrush(RGB(255, 255, 0));
SetBkColor(mem_dc, RGB(255, 255, 0)); SetBkColor(mem_dc, RGB(255, 255, 0));

View File

@ -239,9 +239,9 @@ void SuperEagle(uint8 *srcPtr, uint32 srcPitch,
{ {
uint32 *dP; uint32 *dP;
uint16 *bP; uint16 *bP;
uint16 *xP;
#ifdef MMX #ifdef MMX
uint16 *xP;
if (mmx_cpu && width != 512) if (mmx_cpu && width != 512)
{ {
for (height; height; height-=1) for (height; height; height-=1)
@ -414,9 +414,9 @@ void _2xSaI(uint8 *srcPtr, uint32 srcPitch,
{ {
uint32 *dP; uint32 *dP;
uint16 *bP; uint16 *bP;
uint16 *xP;
#ifdef MMX #ifdef MMX
uint16 *xP;
if (mmx_cpu && width != 512) if (mmx_cpu && width != 512)
{ {
for (height; height; height-=1) for (height; height; height-=1)

View File

@ -246,7 +246,7 @@ SGuitar DefaultGuitar = { false, 'E', 'R', 'T', 'Y' };
SGuitar Guitar; SGuitar Guitar;
u8 guitarState = 0; u8 guitarState = 0;
extern volatile BOOL paused; extern volatile bool paused;
#define MAXKEYPAD 15 #define MAXKEYPAD 15
@ -1889,8 +1889,6 @@ void EnableDisableKeyFields (int index, HWND hDlg)
INT_PTR CALLBACK DlgInputConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) INT_PTR CALLBACK DlgInputConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
char temp[256];
short C;
int i, which; int i, which;
static int index=0; static int index=0;
@ -2083,30 +2081,30 @@ switch(msg)
// break; // break;
} }
switch(HIWORD(wParam)) //switch(HIWORD(wParam))
{ //{
//case CBN_SELCHANGE: // case CBN_SELCHANGE:
// index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); // index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0);
// SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_SETCURSEL,(WPARAM)index,0); // SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_SETCURSEL,(WPARAM)index,0);
// if(index > 4) index += 3; // skip controllers 6, 7, and 8 in the input dialog // if(index > 4) index += 3; // skip controllers 6, 7, and 8 in the input dialog
// if(index < 8) // if(index < 8)
// { // {
// SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); // SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0);
// EnableWindow(GetDlgItem(hDlg,IDC_JPTOGGLE),TRUE); // EnableWindow(GetDlgItem(hDlg,IDC_JPTOGGLE),TRUE);
// } // }
// else // else
// { // {
// SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index-8].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); // SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index-8].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0);
// EnableWindow(GetDlgItem(hDlg,IDC_JPTOGGLE),FALSE); // EnableWindow(GetDlgItem(hDlg,IDC_JPTOGGLE),FALSE);
// } // }
// set_buttoninfo(index,hDlg); // set_buttoninfo(index,hDlg);
// EnableDisableKeyFields(index,hDlg); // EnableDisableKeyFields(index,hDlg);
// break; // break;
} //}
return FALSE; //return FALSE;
} }
@ -2366,20 +2364,20 @@ void input_process()
//not appropriate right now in desmume //not appropriate right now in desmume
//if (paused) return; //if (paused) return;
bool R = joypads[0] & RIGHT_MASK; bool R = (joypads[0] & RIGHT_MASK)!=0;
bool L = joypads[0] & LEFT_MASK; bool L = (joypads[0] & LEFT_MASK)!=0;
bool D = joypads[0] & DOWN_MASK; bool D = (joypads[0] & DOWN_MASK)!=0;
bool U = joypads[0] & UP_MASK; bool U = (joypads[0] & UP_MASK)!=0;
bool T = joypads[0] & START_MASK; bool T = (joypads[0] & START_MASK)!=0;
bool S = joypads[0] & SELECT_MASK; bool S = (joypads[0] & SELECT_MASK)!=0;
bool B = joypads[0] & B_MASK; bool B = (joypads[0] & B_MASK)!=0;
bool A = joypads[0] & A_MASK; bool A = (joypads[0] & A_MASK)!=0;
bool Y = joypads[0] & Y_MASK; bool Y = (joypads[0] & Y_MASK)!=0;
bool X = joypads[0] & X_MASK; bool X = (joypads[0] & X_MASK)!=0;
bool W = joypads[0] & L_MASK; bool W = (joypads[0] & L_MASK)!=0;
bool E = joypads[0] & R_MASK; bool E = (joypads[0] & R_MASK)!=0;
bool G = joypads[0] & DEBUG_MASK; bool G = (joypads[0] & DEBUG_MASK)!=0;
bool F = joypads[0] & LID_MASK; bool F = (joypads[0] & LID_MASK)!=0;
if(AutoHoldPressed && R) AutoHold.Right ^= true; if(AutoHoldPressed && R) AutoHold.Right ^= true;
if(AutoHoldPressed && L) AutoHold.Left ^= true; if(AutoHoldPressed && L) AutoHold.Left ^= true;

View File

@ -62,7 +62,7 @@ void LightView_OnPaintLight(HWND hwnd, int index)
unsigned int color; unsigned int color;
unsigned int direction; unsigned int direction;
ColorCtrl* colorCtrl; //ColorCtrl* colorCtrl;
char buffer[128]; char buffer[128];
// Get necessary information from gfx3d module // Get necessary information from gfx3d module

View File

@ -140,6 +140,10 @@ void wxTest() {
#endif #endif
const int kGapNone = 0;
const int kGapBorder = 5;
const int kGapNDS = 64;
static BOOL OpenCore(const char* filename); static BOOL OpenCore(const char* filename);
//----Recent ROMs menu globals---------- //----Recent ROMs menu globals----------
@ -179,10 +183,15 @@ LPDIRECTDRAWCLIPPER lpDDClipBack=NULL;
#define WM_CUSTKEYDOWN (WM_USER+50) #define WM_CUSTKEYDOWN (WM_USER+50)
#define WM_CUSTKEYUP (WM_USER+51) #define WM_CUSTKEYUP (WM_USER+51)
/* Declare Windows procedure */
inline bool IsDlgCheckboxChecked(HWND hDlg, int id)
{
return IsDlgButtonChecked(hDlg,id) == BST_CHECKED;
}
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char SavName[MAX_PATH] = ""; char SavName[MAX_PATH] = "";
char ImportSavName[MAX_PATH] = ""; char ImportSavName[MAX_PATH] = "";
char szClassName[ ] = "DeSmuME"; char szClassName[ ] = "DeSmuME";
@ -202,9 +211,9 @@ int WndX = 0;
int WndY = 0; int WndY = 0;
extern HWND RamSearchHWnd; extern HWND RamSearchHWnd;
static BOOL lostFocusPause = TRUE; static bool lostFocusPause = true;
static BOOL lastPauseFromLostFocus = FALSE; static bool lastPauseFromLostFocus = false;
static int FrameLimit = 1; static bool FrameLimit = true;
std::vector<HWND> LuaScriptHWnds; std::vector<HWND> LuaScriptHWnds;
LRESULT CALLBACK LuaScriptProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK LuaScriptProc(HWND, UINT, WPARAM, LPARAM);
@ -222,19 +231,19 @@ TOOLSCLASS *ViewOAM = NULL;
TOOLSCLASS *ViewMatrices = NULL; TOOLSCLASS *ViewMatrices = NULL;
TOOLSCLASS *ViewLights = NULL; TOOLSCLASS *ViewLights = NULL;
volatile BOOL execute = FALSE; volatile bool execute = false;
volatile BOOL paused = TRUE; volatile bool paused = true;
volatile BOOL pausedByMinimize = FALSE; volatile BOOL pausedByMinimize = FALSE;
u32 glock = 0; u32 glock = 0;
BOOL finished = FALSE; BOOL finished = FALSE;
BOOL romloaded = FALSE; bool romloaded = false;
void SetScreenGap(int gap); void SetScreenGap(int gap);
void SetRotate(HWND hwnd, int rot); void SetRotate(HWND hwnd, int rot);
BOOL ForceRatio = TRUE; bool ForceRatio = true;
float DefaultWidth; float DefaultWidth;
float DefaultHeight; float DefaultHeight;
float widthTradeOff; float widthTradeOff;
@ -258,7 +267,7 @@ GPU3DInterface *core3DList[] = {
NULL NULL
}; };
int autoframeskipenab=0; bool autoframeskipenab=0;
int frameskiprate=0; int frameskiprate=0;
int emu_paused = 0; int emu_paused = 0;
bool frameAdvance = false; bool frameAdvance = false;
@ -603,7 +612,7 @@ void SaveRecentRoms()
{ {
temp.str(""); temp.str("");
temp << "Recent Rom " << (x+1); temp << "Recent Rom " << (x+1);
if (x < RecentRoms.size()) //If it exists in the array, save it if (x < (int)RecentRoms.size()) //If it exists in the array, save it
WritePrivateProfileString("General",temp.str().c_str(),RecentRoms[x].c_str(),IniName); WritePrivateProfileString("General",temp.str().c_str(),RecentRoms[x].c_str(),IniName);
else //Else, make it empty else //Else, make it empty
WritePrivateProfileString("General",temp.str().c_str(), "",IniName); WritePrivateProfileString("General",temp.str().c_str(), "",IniName);
@ -917,7 +926,6 @@ void CheckMessages()
DWORD WINAPI run() DWORD WINAPI run()
{ {
char txt[80];
u32 cycles = 0; u32 cycles = 0;
int wait=0; int wait=0;
u64 freq; u64 freq;
@ -933,11 +941,8 @@ DWORD WINAPI run()
int fps=0; int fps=0;
int fpsframecount=0; int fpsframecount=0;
u64 fpsticks=0; u64 fpsticks=0;
int res;
HWND hwnd = MainWindow->getHWnd(); HWND hwnd = MainWindow->getHWnd();
DDCAPS hw_caps, sw_caps;
InitSpeedThrottle(); InitSpeedThrottle();
osd->setRotate(video.rotation); osd->setRotate(video.rotation);
@ -1325,9 +1330,9 @@ void CheckLanguage(UINT id)
{ {
int i; int i;
for (i = IDC_LANGENGLISH; i < IDC_LANG_CHINESE_SIMPLIFIED+1; i++) for (i = IDC_LANGENGLISH; i < IDC_LANG_CHINESE_SIMPLIFIED+1; i++)
MainWindow->checkMenu(i, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(i, false);
MainWindow->checkMenu(id, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(id, true);
} }
void ChangeLanguage(int id) void ChangeLanguage(int id)
@ -1478,30 +1483,30 @@ int _main()
windowSize = GetPrivateProfileInt("Video","Window Size", 0, IniName); windowSize = GetPrivateProfileInt("Video","Window Size", 0, IniName);
video.rotation = GetPrivateProfileInt("Video","Window Rotate", 0, IniName); video.rotation = GetPrivateProfileInt("Video","Window Rotate", 0, IniName);
ForceRatio = GetPrivateProfileInt("Video","Window Force Ratio", 1, IniName); ForceRatio = GetPrivateProfileBool("Video","Window Force Ratio", 1, IniName);
WndX = GetPrivateProfileInt("Video","WindowPosX", CW_USEDEFAULT, IniName); WndX = GetPrivateProfileInt("Video","WindowPosX", CW_USEDEFAULT, IniName);
WndY = GetPrivateProfileInt("Video","WindowPosY", CW_USEDEFAULT, IniName); WndY = GetPrivateProfileInt("Video","WindowPosY", CW_USEDEFAULT, IniName);
video.width = GetPrivateProfileInt("Video", "Width", 256, IniName); video.width = GetPrivateProfileInt("Video", "Width", 256, IniName);
video.height = GetPrivateProfileInt("Video", "Height", 384, IniName); video.height = GetPrivateProfileInt("Video", "Height", 384, IniName);
CommonSettings.hud.FpsDisplay = GetPrivateProfileBool("Display","Display Fps", 0, IniName); CommonSettings.hud.FpsDisplay = GetPrivateProfileBool("Display","Display Fps", false, IniName);
CommonSettings.hud.FrameCounterDisplay = GetPrivateProfileBool("Display","FrameCounter", 0, IniName); CommonSettings.hud.FrameCounterDisplay = GetPrivateProfileBool("Display","FrameCounter", false, IniName);
CommonSettings.hud.ShowInputDisplay = GetPrivateProfileBool("Display","Display Input", 0, IniName); CommonSettings.hud.ShowInputDisplay = GetPrivateProfileBool("Display","Display Input", false, IniName);
CommonSettings.hud.ShowLagFrameCounter = GetPrivateProfileBool("Display","Display Lag Counter", 0, IniName); CommonSettings.hud.ShowLagFrameCounter = GetPrivateProfileBool("Display","Display Lag Counter", false, IniName);
CommonSettings.hud.ShowMicrophone = GetPrivateProfileBool("Display","Display Microphone", 0, IniName); CommonSettings.hud.ShowMicrophone = GetPrivateProfileBool("Display","Display Microphone", false, IniName);
video.screengap = GetPrivateProfileInt("Display", "ScreenGap", 0, IniName); video.screengap = GetPrivateProfileInt("Display", "ScreenGap", 0, IniName);
FrameLimit = GetPrivateProfileInt("FrameLimit", "FrameLimit", 1, IniName); FrameLimit = GetPrivateProfileBool("FrameLimit", "FrameLimit", true, IniName);
CommonSettings.showGpu.main = GetPrivateProfileInt("Display", "MainGpu", 1, IniName) != 0; CommonSettings.showGpu.main = GetPrivateProfileInt("Display", "MainGpu", 1, IniName) != 0;
CommonSettings.showGpu.sub = GetPrivateProfileInt("Display", "SubGpu", 1, IniName) != 0; CommonSettings.showGpu.sub = GetPrivateProfileInt("Display", "SubGpu", 1, IniName) != 0;
lostFocusPause = GetPrivateProfileInt("Focus", "BackgroundPause", 0, IniName); lostFocusPause = GetPrivateProfileBool("Focus", "BackgroundPause", false, IniName);
//Get Ram-Watch values //Get Ram-Watch values
RWSaveWindowPos = GetPrivateProfileInt("RamWatch", "SaveWindowPos", 0, IniName); RWSaveWindowPos = GetPrivateProfileBool("RamWatch", "SaveWindowPos", false, IniName);
ramw_x = GetPrivateProfileInt("RamWatch", "RWWindowPosX", 0, IniName); ramw_x = GetPrivateProfileInt("RamWatch", "RWWindowPosX", 0, IniName);
ramw_y = GetPrivateProfileInt("RamWatch", "RWWindowPosY", 0, IniName); ramw_y = GetPrivateProfileInt("RamWatch", "RWWindowPosY", 0, IniName);
AutoRWLoad = GetPrivateProfileInt("RamWatch", "Auto-load", 0, IniName); AutoRWLoad = GetPrivateProfileBool("RamWatch", "Auto-load", false, IniName);
for(int i = 0; i < MAX_RECENT_WATCHES; i++) for(int i = 0; i < MAX_RECENT_WATCHES; i++)
{ {
char str[256]; char str[256];
@ -1673,13 +1678,13 @@ int _main()
{ {
autoframeskipenab=1; autoframeskipenab=1;
frameskiprate=0; frameskiprate=0;
MainWindow->checkMenu(IDC_FRAMESKIPAUTO, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDC_FRAMESKIPAUTO, true);
} }
else else
{ {
autoframeskipenab=0; autoframeskipenab=0;
frameskiprate=atoi(text); frameskiprate=atoi(text);
MainWindow->checkMenu(frameskiprate + IDC_FRAMESKIP0, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(frameskiprate + IDC_FRAMESKIP0, true);
} }
int KeyInRepeatMSec=20; int KeyInRepeatMSec=20;
@ -1687,7 +1692,7 @@ int _main()
hKeyInputTimer = timeSetEvent (KeyInRepeatMSec, 0, KeyInputTimer, 0, TIME_PERIODIC); hKeyInputTimer = timeSetEvent (KeyInRepeatMSec, 0, KeyInputTimer, 0, TIME_PERIODIC);
cur3DCore = GetPrivateProfileInt("3D", "Renderer", GPU3D_OPENGL, IniName); cur3DCore = GetPrivateProfileInt("3D", "Renderer", GPU3D_OPENGL, IniName);
CommonSettings.HighResolutionInterpolateColor = GetPrivateProfileInt("3D", "HighResolutionInterpolateColor", 1, IniName); CommonSettings.HighResolutionInterpolateColor = GetPrivateProfileBool("3D", "HighResolutionInterpolateColor", 1, IniName);
CommonSettings.gfx3d_flushMode = GetPrivateProfileInt("3D", "AlternateFlush", 0, IniName); CommonSettings.gfx3d_flushMode = GetPrivateProfileInt("3D", "AlternateFlush", 0, IniName);
NDS_3D_ChangeCore(cur3DCore); NDS_3D_ChangeCore(cur3DCore);
@ -1712,15 +1717,15 @@ int _main()
sndvolume = GetPrivateProfileInt("Sound","Volume",100, IniName); sndvolume = GetPrivateProfileInt("Sound","Volume",100, IniName);
SPU_SetVolume(sndvolume); SPU_SetVolume(sndvolume);
CommonSettings.DebugConsole = GetPrivateProfileInt("Emulation", "DebugConsole", FALSE, IniName); CommonSettings.DebugConsole = GetPrivateProfileBool("Emulation", "DebugConsole", FALSE, IniName);
CommonSettings.UseExtBIOS = GetPrivateProfileInt("BIOS", "UseExtBIOS", FALSE, IniName); CommonSettings.UseExtBIOS = GetPrivateProfileBool("BIOS", "UseExtBIOS", FALSE, IniName);
GetPrivateProfileString("BIOS", "ARM9BIOSFile", "bios9.bin", CommonSettings.ARM9BIOS, 256, IniName); GetPrivateProfileString("BIOS", "ARM9BIOSFile", "bios9.bin", CommonSettings.ARM9BIOS, 256, IniName);
GetPrivateProfileString("BIOS", "ARM7BIOSFile", "bios7.bin", CommonSettings.ARM7BIOS, 256, IniName); GetPrivateProfileString("BIOS", "ARM7BIOSFile", "bios7.bin", CommonSettings.ARM7BIOS, 256, IniName);
CommonSettings.SWIFromBIOS = GetPrivateProfileInt("BIOS", "SWIFromBIOS", FALSE, IniName); CommonSettings.SWIFromBIOS = GetPrivateProfileBool("BIOS", "SWIFromBIOS", FALSE, IniName);
CommonSettings.UseExtFirmware = GetPrivateProfileInt("Firmware", "UseExtFirmware", FALSE, IniName); CommonSettings.UseExtFirmware = GetPrivateProfileBool("Firmware", "UseExtFirmware", FALSE, IniName);
GetPrivateProfileString("Firmware", "FirmwareFile", "firmware.bin", CommonSettings.Firmware, 256, IniName); GetPrivateProfileString("Firmware", "FirmwareFile", "firmware.bin", CommonSettings.Firmware, 256, IniName);
CommonSettings.BootFromFirmware = GetPrivateProfileInt("Firmware", "BootFromFirmware", FALSE, IniName); CommonSettings.BootFromFirmware = GetPrivateProfileBool("Firmware", "BootFromFirmware", FALSE, IniName);
CommonSettings.wifiBridgeAdapterNum = GetPrivateProfileInt("Wifi", "BridgeAdapter", 0, IniName); CommonSettings.wifiBridgeAdapterNum = GetPrivateProfileInt("Wifi", "BridgeAdapter", 0, IniName);
@ -1972,10 +1977,10 @@ void UpdateScreenRects()
void SetScreenGap(int gap) void SetScreenGap(int gap)
{ {
video.screengap = gap; video.screengap = gap;
MainWindow->setMinSize(video.rotatedwidthgap(), video.rotatedheightgap()); MainWindow->setMinSize(video.rotatedwidthgap(), video.rotatedheightgap());
MainWindow->setClientSize(video.rotatedwidthgap(), video.rotatedheightgap()); MainWindow->setClientSize(video.rotatedwidthgap(), video.rotatedheightgap());
UpdateWndRects(MainWindow->getHWnd());
} }
//======================================================================================== //========================================================================================
@ -2471,7 +2476,8 @@ void RunConfig(CONFIGSCREEN which)
NDS_UnPause(); NDS_UnPause();
} }
void FilterUpdate (HWND hwnd, bool user){ void FilterUpdate (HWND hwnd, bool user)
{
UpdateScreenRects(); UpdateScreenRects();
UpdateWndRects(hwnd); UpdateWndRects(hwnd);
SetScreenGap(video.screengap); SetScreenGap(video.screengap);
@ -2483,6 +2489,11 @@ void FilterUpdate (HWND hwnd, bool user){
WritePrivateProfileInt("Video", "Height", video.height, IniName); WritePrivateProfileInt("Video", "Height", video.height, IniName);
} }
void DesEnableMenuItem(HMENU hMenu, UINT uIDEnableItem, bool enable)
{
EnableMenuItem(hMenu, uIDEnableItem, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED));
}
//======================================================================================== //========================================================================================
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
@ -2507,108 +2518,121 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
SetMenuItemInfo(mainMenu, IDM_FILE_RECORDWAV, FALSE, &mii); SetMenuItemInfo(mainMenu, IDM_FILE_RECORDWAV, FALSE, &mii);
//Menu items dependent on a ROM loaded //Menu items dependent on a ROM loaded
EnableMenuItem(mainMenu, IDM_GAME_INFO, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_GAME_INFO, romloaded);
EnableMenuItem(mainMenu, IDM_IMPORTBACKUPMEMORY,MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_IMPORTBACKUPMEMORY,romloaded);
EnableMenuItem(mainMenu, IDM_EXPORTBACKUPMEMORY,MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_EXPORTBACKUPMEMORY,romloaded);
EnableMenuItem(mainMenu, IDM_STATE_SAVE, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_STATE_SAVE, romloaded);
EnableMenuItem(mainMenu, IDM_STATE_LOAD, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_STATE_LOAD, romloaded);
EnableMenuItem(mainMenu, IDM_PRINTSCREEN, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_PRINTSCREEN, romloaded);
EnableMenuItem(mainMenu, IDM_QUICK_PRINTSCREEN, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_QUICK_PRINTSCREEN, romloaded);
EnableMenuItem(mainMenu, IDM_FILE_RECORDAVI, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_FILE_RECORDAVI, romloaded);
EnableMenuItem(mainMenu, IDM_FILE_RECORDWAV, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_FILE_RECORDWAV, romloaded);
EnableMenuItem(mainMenu, IDM_RESET, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_RESET, romloaded);
EnableMenuItem(mainMenu, IDM_SHUT_UP, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_SHUT_UP, romloaded);
EnableMenuItem(mainMenu, IDM_CHEATS_LIST, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_CHEATS_LIST, romloaded);
EnableMenuItem(mainMenu, IDM_CHEATS_SEARCH, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_CHEATS_SEARCH, romloaded);
EnableMenuItem(mainMenu, IDM_WIFISETTINGS, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_WIFISETTINGS, romloaded);
EnableMenuItem(mainMenu, IDM_RECORD_MOVIE, MF_BYCOMMAND | (romloaded && movieMode == MOVIEMODE_INACTIVE) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_RECORD_MOVIE, (romloaded && movieMode == MOVIEMODE_INACTIVE));
EnableMenuItem(mainMenu, IDM_PLAY_MOVIE, MF_BYCOMMAND | (romloaded && movieMode == MOVIEMODE_INACTIVE) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_PLAY_MOVIE, (romloaded && movieMode == MOVIEMODE_INACTIVE));
EnableMenuItem(mainMenu, IDM_STOPMOVIE, MF_BYCOMMAND | (romloaded && movieMode != MOVIEMODE_INACTIVE) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, IDM_STOPMOVIE, (romloaded && movieMode != MOVIEMODE_INACTIVE));
EnableMenuItem(mainMenu, ID_RAM_WATCH, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, ID_RAM_WATCH, romloaded);
EnableMenuItem(mainMenu, ID_RAM_SEARCH, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); DesEnableMenuItem(mainMenu, ID_RAM_SEARCH, romloaded);
//Update savestate slot items based on ROM loaded //Update savestate slot items based on ROM loaded
for (int x = 0; x < 10; x++) for (int x = 0; x < 10; x++)
{ {
EnableMenuItem(mainMenu, IDM_STATE_SAVE_F1+x, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); EnableMenuItem(mainMenu, IDM_STATE_SAVE_F1+x, romloaded);
EnableMenuItem(mainMenu, IDM_STATE_LOAD_F1+x, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); EnableMenuItem(mainMenu, IDM_STATE_LOAD_F1+x, romloaded);
} }
//Gray the recent ROM menu item if there are no recent ROMs //Gray the recent ROM menu item if there are no recent ROMs
EnableMenuItem(mainMenu, ID_FILE_RECENTROM, MF_BYCOMMAND | (RecentRoms.size()) ? MF_ENABLED : MF_GRAYED); EnableMenuItem(mainMenu, ID_FILE_RECENTROM, (RecentRoms.size()));
//Updated Checked menu items //Updated Checked menu items
//Pause //Pause
MainWindow->checkMenu(IDM_PAUSE, MF_BYCOMMAND | ((paused)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDM_PAUSE, ((paused)));
//Force Maintain Ratio //Force Maintain Ratio
MainWindow->checkMenu(IDC_FORCERATIO, MF_BYCOMMAND | ((ForceRatio)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_FORCERATIO, ((ForceRatio)));
//Screen rotation //Screen rotation
MainWindow->checkMenu(IDC_ROTATE0, MF_BYCOMMAND | ((video.rotation==0)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_ROTATE0, ((video.rotation==0)));
MainWindow->checkMenu(IDC_ROTATE90, MF_BYCOMMAND | ((video.rotation==90)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_ROTATE90, ((video.rotation==90)));
MainWindow->checkMenu(IDC_ROTATE180, MF_BYCOMMAND | ((video.rotation==180)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_ROTATE180, ((video.rotation==180)));
MainWindow->checkMenu(IDC_ROTATE270, MF_BYCOMMAND | ((video.rotation==270)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_ROTATE270, ((video.rotation==270)));
//Window Size //Window Size
MainWindow->checkMenu(IDC_WINDOW1X, MF_BYCOMMAND | ((windowSize==1)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_WINDOW1X, ((windowSize==1)));
MainWindow->checkMenu(IDC_WINDOW1_5X, MF_BYCOMMAND |((windowSize==65535)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_WINDOW1_5X, ((windowSize==65535)));
MainWindow->checkMenu(IDC_WINDOW2X, MF_BYCOMMAND | ((windowSize==2)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_WINDOW2X, ((windowSize==2)));
MainWindow->checkMenu(IDC_WINDOW2_5X, MF_BYCOMMAND |((windowSize==65534)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_WINDOW2_5X, ((windowSize==65534)));
MainWindow->checkMenu(IDC_WINDOW3X, MF_BYCOMMAND | ((windowSize==3)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_WINDOW3X, ((windowSize==3)));
MainWindow->checkMenu(IDC_WINDOW4X, MF_BYCOMMAND | ((windowSize==4)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_WINDOW4X, ((windowSize==4)));
//Screen Separation //Screen Separation
MainWindow->checkMenu(IDM_SCREENSEP_NONE, MF_BYCOMMAND | ((video.screengap==0)? MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDM_SCREENSEP_NONE, ((video.screengap==0)));
MainWindow->checkMenu(IDM_SCREENSEP_BORDER, MF_BYCOMMAND | ((video.screengap==5)? MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDM_SCREENSEP_BORDER, ((video.screengap==5)));
MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, MF_BYCOMMAND | ((video.screengap==64)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, ((video.screengap==64)));
//Counters / Etc. //Counters / Etc.
MainWindow->checkMenu(ID_VIEW_FRAMECOUNTER, MF_BYCOMMAND | ((CommonSettings.hud.FrameCounterDisplay)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(ID_VIEW_FRAMECOUNTER,CommonSettings.hud.FrameCounterDisplay);
MainWindow->checkMenu(ID_VIEW_DISPLAYFPS, MF_BYCOMMAND | ((CommonSettings.hud.FpsDisplay) ?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(ID_VIEW_DISPLAYFPS,CommonSettings.hud.FpsDisplay);
MainWindow->checkMenu(ID_VIEW_DISPLAYINPUT, MF_BYCOMMAND | ((CommonSettings.hud.ShowInputDisplay) ?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(ID_VIEW_DISPLAYINPUT,CommonSettings.hud.ShowInputDisplay);
MainWindow->checkMenu(ID_VIEW_DISPLAYLAG, MF_BYCOMMAND | ((CommonSettings.hud.ShowLagFrameCounter)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(ID_VIEW_DISPLAYLAG,CommonSettings.hud.ShowLagFrameCounter);
MainWindow->checkMenu(ID_VIEW_DISPLAYMICROPHONE, MF_BYCOMMAND | ((CommonSettings.hud.ShowMicrophone)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(ID_VIEW_DISPLAYMICROPHONE,CommonSettings.hud.ShowMicrophone);
MainWindow->checkMenu(ID_VIEW_HUDEDITOR, MF_BYCOMMAND | ((HudEditorMode) ?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(ID_VIEW_HUDEDITOR, HudEditorMode);
MainWindow->checkMenu(IDC_FRAMELIMIT, MF_BYCOMMAND | ((FrameLimit) ?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_FRAMELIMIT, FrameLimit);
//Frame Skip //Frame Skip
MainWindow->checkMenu(IDC_FRAMESKIPAUTO, MF_BYCOMMAND | ((autoframeskipenab)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_FRAMESKIPAUTO, ((autoframeskipenab)));
MainWindow->checkMenu(IDC_FRAMESKIP0, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==0) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP0, (!autoframeskipenab && frameskiprate==0) );
MainWindow->checkMenu(IDC_FRAMESKIP1, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==1) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP1, (!autoframeskipenab && frameskiprate==1) );
MainWindow->checkMenu(IDC_FRAMESKIP2, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==2) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP2, (!autoframeskipenab && frameskiprate==2) );
MainWindow->checkMenu(IDC_FRAMESKIP3, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==3) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP3, (!autoframeskipenab && frameskiprate==3) );
MainWindow->checkMenu(IDC_FRAMESKIP4, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==4) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP4, (!autoframeskipenab && frameskiprate==4) );
MainWindow->checkMenu(IDC_FRAMESKIP5, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==5) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP5, (!autoframeskipenab && frameskiprate==5) );
MainWindow->checkMenu(IDC_FRAMESKIP6, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==6) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP6, (!autoframeskipenab && frameskiprate==6) );
MainWindow->checkMenu(IDC_FRAMESKIP7, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==7) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP7, (!autoframeskipenab && frameskiprate==7) );
MainWindow->checkMenu(IDC_FRAMESKIP8, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==8) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP8, (!autoframeskipenab && frameskiprate==8) );
MainWindow->checkMenu(IDC_FRAMESKIP9, MF_BYCOMMAND | (!autoframeskipenab && frameskiprate==9) ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_FRAMESKIP9, (!autoframeskipenab && frameskiprate==9) );
MainWindow->checkMenu(IDM_MGPU, MF_BYCOMMAND | CommonSettings.showGpu.main ? MF_CHECKED:MF_UNCHECKED); //gpu visibility toggles
MainWindow->checkMenu(IDM_SGPU, MF_BYCOMMAND | CommonSettings.showGpu.sub ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDM_MGPU, CommonSettings.showGpu.main );
MainWindow->checkMenu(IDM_SGPU, CommonSettings.showGpu.sub );
//TODO - change how the gpu visibility flags work
//Filters //Filters
MainWindow->checkMenu(IDM_RENDER_NORMAL, video.currentfilter == video.NONE );
MainWindow->checkMenu(IDM_RENDER_HQ2X, video.currentfilter == video.HQ2X );
MainWindow->checkMenu(IDM_RENDER_2XSAI, video.currentfilter == video._2XSAI );
MainWindow->checkMenu(IDM_RENDER_SUPER2XSAI, video.currentfilter == video.SUPER2XSAI );
MainWindow->checkMenu(IDM_RENDER_SUPEREAGLE, video.currentfilter == video.SUPEREAGLE );
MainWindow->checkMenu(IDM_RENDER_SCANLINE, video.currentfilter == video.SCANLINE );
MainWindow->checkMenu(IDM_RENDER_BILINEAR, video.currentfilter == video.BILINEAR );
MainWindow->checkMenu(IDM_RENDER_NORMAL, MF_BYCOMMAND | video.currentfilter == video.NONE ? MF_CHECKED:MF_UNCHECKED); MainWindow->checkMenu(IDC_STATEREWINDING, staterewindingenabled == 1 );
MainWindow->checkMenu(IDM_RENDER_HQ2X, MF_BYCOMMAND | video.currentfilter == video.HQ2X ? MF_CHECKED:MF_UNCHECKED);
MainWindow->checkMenu(IDM_RENDER_2XSAI, MF_BYCOMMAND | video.currentfilter == video._2XSAI ? MF_CHECKED:MF_UNCHECKED);
MainWindow->checkMenu(IDM_RENDER_SUPER2XSAI, MF_BYCOMMAND | video.currentfilter == video.SUPER2XSAI ? MF_CHECKED:MF_UNCHECKED);
MainWindow->checkMenu(IDM_RENDER_SUPEREAGLE, MF_BYCOMMAND | video.currentfilter == video.SUPEREAGLE ? MF_CHECKED:MF_UNCHECKED);
MainWindow->checkMenu(IDM_RENDER_SCANLINE, MF_BYCOMMAND | video.currentfilter == video.SCANLINE ? MF_CHECKED:MF_UNCHECKED);
MainWindow->checkMenu(IDM_RENDER_BILINEAR, MF_BYCOMMAND | video.currentfilter == video.BILINEAR ? MF_CHECKED:MF_UNCHECKED);
MainWindow->checkMenu(IDC_STATEREWINDING, MF_BYCOMMAND | staterewindingenabled == 1 ? MF_CHECKED:MF_UNCHECKED);
//Language selection //Language selection
MainWindow->checkMenu(IDC_BACKGROUNDPAUSE, lostFocusPause);
//screen gaps
MainWindow->checkMenu(IDM_SCREENSEP_NONE, false);
MainWindow->checkMenu(IDM_SCREENSEP_BORDER, false);
MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, false);
if(video.screengap == kGapNone)
MainWindow->checkMenu(IDM_SCREENSEP_NONE, true);
else if(video.screengap == kGapBorder)
MainWindow->checkMenu(IDM_SCREENSEP_BORDER, true);
else if(video.screengap == kGapNDS)
MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, true);
MainWindow->checkMenu(IDC_BACKGROUNDPAUSE, MF_BYCOMMAND | ((lostFocusPause)?MF_CHECKED:MF_UNCHECKED));
//Save type //Save type
const int savelist[] = {IDC_SAVETYPE1,IDC_SAVETYPE2,IDC_SAVETYPE3,IDC_SAVETYPE4,IDC_SAVETYPE5,IDC_SAVETYPE6,IDC_SAVETYPE7}; const int savelist[] = {IDC_SAVETYPE1,IDC_SAVETYPE2,IDC_SAVETYPE3,IDC_SAVETYPE4,IDC_SAVETYPE5,IDC_SAVETYPE6,IDC_SAVETYPE7};
for(int i=0;i<7;i++) MainWindow->checkMenu(savelist[i], MF_BYCOMMAND | MF_UNCHECKED); for(int i=0;i<7;i++)
MainWindow->checkMenu(savelist[CommonSettings.manualBackupType], MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(savelist[i], MF_UNCHECKED);
MainWindow->checkMenu(savelist[CommonSettings.manualBackupType], true);
return 0; return 0;
@ -3216,96 +3240,96 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if(MainScreen.gpu->dispBG[0]) if(MainScreen.gpu->dispBG[0])
{ {
GPU_remove(MainScreen.gpu, 0); GPU_remove(MainScreen.gpu, 0);
MainWindow->checkMenu(IDM_MBG0, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDM_MBG0, false);
} }
else else
{ {
GPU_addBack(MainScreen.gpu, 0); GPU_addBack(MainScreen.gpu, 0);
MainWindow->checkMenu(IDM_MBG0, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDM_MBG0, true);
} }
return 0; return 0;
case IDM_MBG1 : case IDM_MBG1 :
if(MainScreen.gpu->dispBG[1]) if(MainScreen.gpu->dispBG[1])
{ {
GPU_remove(MainScreen.gpu, 1); GPU_remove(MainScreen.gpu, 1);
MainWindow->checkMenu(IDM_MBG1, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDM_MBG1, false);
} }
else else
{ {
GPU_addBack(MainScreen.gpu, 1); GPU_addBack(MainScreen.gpu, 1);
MainWindow->checkMenu(IDM_MBG1, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDM_MBG1, true);
} }
return 0; return 0;
case IDM_MBG2 : case IDM_MBG2 :
if(MainScreen.gpu->dispBG[2]) if(MainScreen.gpu->dispBG[2])
{ {
GPU_remove(MainScreen.gpu, 2); GPU_remove(MainScreen.gpu, 2);
MainWindow->checkMenu(IDM_MBG2, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDM_MBG2, false);
} }
else else
{ {
GPU_addBack(MainScreen.gpu, 2); GPU_addBack(MainScreen.gpu, 2);
MainWindow->checkMenu(IDM_MBG2, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDM_MBG2, true);
} }
return 0; return 0;
case IDM_MBG3 : case IDM_MBG3 :
if(MainScreen.gpu->dispBG[3]) if(MainScreen.gpu->dispBG[3])
{ {
GPU_remove(MainScreen.gpu, 3); GPU_remove(MainScreen.gpu, 3);
MainWindow->checkMenu(IDM_MBG3, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDM_MBG3, false);
} }
else else
{ {
GPU_addBack(MainScreen.gpu, 3); GPU_addBack(MainScreen.gpu, 3);
MainWindow->checkMenu(IDM_MBG3, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDM_MBG3, true);
} }
return 0; return 0;
case IDM_SBG0 : case IDM_SBG0 :
if(SubScreen.gpu->dispBG[0]) if(SubScreen.gpu->dispBG[0])
{ {
GPU_remove(SubScreen.gpu, 0); GPU_remove(SubScreen.gpu, 0);
MainWindow->checkMenu(IDM_SBG0, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDM_SBG0, false);
} }
else else
{ {
GPU_addBack(SubScreen.gpu, 0); GPU_addBack(SubScreen.gpu, 0);
MainWindow->checkMenu(IDM_SBG0, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDM_SBG0, true);
} }
return 0; return 0;
case IDM_SBG1 : case IDM_SBG1 :
if(SubScreen.gpu->dispBG[1]) if(SubScreen.gpu->dispBG[1])
{ {
GPU_remove(SubScreen.gpu, 1); GPU_remove(SubScreen.gpu, 1);
MainWindow->checkMenu(IDM_SBG1, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDM_SBG1, false);
} }
else else
{ {
GPU_addBack(SubScreen.gpu, 1); GPU_addBack(SubScreen.gpu, 1);
MainWindow->checkMenu(IDM_SBG1, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDM_SBG1, true);
} }
return 0; return 0;
case IDM_SBG2 : case IDM_SBG2 :
if(SubScreen.gpu->dispBG[2]) if(SubScreen.gpu->dispBG[2])
{ {
GPU_remove(SubScreen.gpu, 2); GPU_remove(SubScreen.gpu, 2);
MainWindow->checkMenu(IDM_SBG2, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDM_SBG2, false);
} }
else else
{ {
GPU_addBack(SubScreen.gpu, 2); GPU_addBack(SubScreen.gpu, 2);
MainWindow->checkMenu(IDM_SBG2, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDM_SBG2, true);
} }
return 0; return 0;
case IDM_SBG3 : case IDM_SBG3 :
if(SubScreen.gpu->dispBG[3]) if(SubScreen.gpu->dispBG[3])
{ {
GPU_remove(SubScreen.gpu, 3); GPU_remove(SubScreen.gpu, 3);
MainWindow->checkMenu(IDM_SBG3, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDM_SBG3, false);
} }
else else
{ {
GPU_addBack(SubScreen.gpu, 3); GPU_addBack(SubScreen.gpu, 3);
MainWindow->checkMenu(IDM_SBG3, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(IDM_SBG3, true);
} }
return 0; return 0;
@ -3335,54 +3359,48 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
return 0; return 0;
case ID_VIEW_FRAMECOUNTER: case ID_VIEW_FRAMECOUNTER:
CommonSettings.hud.FrameCounterDisplay ^= true; CommonSettings.hud.FrameCounterDisplay ^= true;
MainWindow->checkMenu(ID_VIEW_FRAMECOUNTER, CommonSettings.hud.FrameCounterDisplay ? MF_CHECKED : MF_UNCHECKED);
WritePrivateProfileBool("Display", "Display Fps", CommonSettings.hud.FpsDisplay, IniName); WritePrivateProfileBool("Display", "Display Fps", CommonSettings.hud.FpsDisplay, IniName);
return 0; return 0;
case ID_VIEW_DISPLAYFPS: case ID_VIEW_DISPLAYFPS:
CommonSettings.hud.FpsDisplay ^= true; CommonSettings.hud.FpsDisplay ^= true;
MainWindow->checkMenu(ID_VIEW_DISPLAYFPS, CommonSettings.hud.FpsDisplay ? MF_CHECKED : MF_UNCHECKED);
WritePrivateProfileBool("Display", "Display Fps", CommonSettings.hud.FpsDisplay, IniName); WritePrivateProfileBool("Display", "Display Fps", CommonSettings.hud.FpsDisplay, IniName);
osd->clear(); osd->clear();
return 0; return 0;
case ID_VIEW_DISPLAYINPUT: case ID_VIEW_DISPLAYINPUT:
CommonSettings.hud.ShowInputDisplay ^= true; CommonSettings.hud.ShowInputDisplay ^= true;
MainWindow->checkMenu(ID_VIEW_DISPLAYINPUT, CommonSettings.hud.ShowInputDisplay ? MF_CHECKED : MF_UNCHECKED);
WritePrivateProfileBool("Display", "Display Input", CommonSettings.hud.ShowInputDisplay, IniName); WritePrivateProfileBool("Display", "Display Input", CommonSettings.hud.ShowInputDisplay, IniName);
osd->clear(); osd->clear();
return 0; return 0;
case ID_VIEW_DISPLAYLAG: case ID_VIEW_DISPLAYLAG:
CommonSettings.hud.ShowLagFrameCounter ^= true; CommonSettings.hud.ShowLagFrameCounter ^= true;
MainWindow->checkMenu(ID_VIEW_DISPLAYLAG, CommonSettings.hud.ShowLagFrameCounter ? MF_CHECKED : MF_UNCHECKED);
WritePrivateProfileBool("Display", "Display Lag Counter", CommonSettings.hud.ShowLagFrameCounter, IniName); WritePrivateProfileBool("Display", "Display Lag Counter", CommonSettings.hud.ShowLagFrameCounter, IniName);
osd->clear(); osd->clear();
return 0; return 0;
case ID_VIEW_HUDEDITOR: case ID_VIEW_HUDEDITOR:
HudEditorMode ^= true; HudEditorMode ^= true;
MainWindow->checkMenu(ID_VIEW_HUDEDITOR, HudEditorMode ? MF_CHECKED : MF_UNCHECKED);
osd->clear(); osd->clear();
osd->border(HudEditorMode); osd->border(HudEditorMode);
return 0; return 0;
case ID_VIEW_DISPLAYMICROPHONE: case ID_VIEW_DISPLAYMICROPHONE:
CommonSettings.hud.ShowMicrophone ^= true; CommonSettings.hud.ShowMicrophone ^= true;
MainWindow->checkMenu(ID_VIEW_DISPLAYMICROPHONE, CommonSettings.hud.ShowMicrophone ? MF_CHECKED : MF_UNCHECKED);
WritePrivateProfileBool("Display", "Display Microphone", CommonSettings.hud.ShowMicrophone, IniName); WritePrivateProfileBool("Display", "Display Microphone", CommonSettings.hud.ShowMicrophone, IniName);
osd->clear(); osd->clear();
return 0; return 0;
case ID_RAM_SEARCH: case ID_RAM_SEARCH:
if(!RamSearchHWnd) if(!RamSearchHWnd)
{ {
InitRamSearch(); InitRamSearch();
RamSearchHWnd = CreateDialog(hAppInst, MAKEINTRESOURCE(IDD_RAMSEARCH), hwnd, (DLGPROC) RamSearchProc); RamSearchHWnd = CreateDialog(hAppInst, MAKEINTRESOURCE(IDD_RAMSEARCH), hwnd, (DLGPROC) RamSearchProc);
} }
else else
SetForegroundWindow(RamSearchHWnd); SetForegroundWindow(RamSearchHWnd);
break; break;
case ID_RAM_WATCH: case ID_RAM_WATCH:
if(!RamWatchHWnd) if(!RamWatchHWnd)
@ -3483,35 +3501,17 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case IDC_FRAMELIMIT: case IDC_FRAMELIMIT:
FrameLimit ^= 1; FrameLimit ^= 1;
MainWindow->checkMenu(IDC_FRAMELIMIT, FrameLimit ? MF_CHECKED : MF_UNCHECKED);
WritePrivateProfileInt("FrameLimit", "FrameLimit", FrameLimit, IniName); WritePrivateProfileInt("FrameLimit", "FrameLimit", FrameLimit, IniName);
return 0; return 0;
case IDM_SCREENSEP_NONE: case IDM_SCREENSEP_NONE:
{ SetScreenGap(kGapNone);
SetScreenGap(0);
MainWindow->checkMenu(IDM_SCREENSEP_NONE, MF_BYCOMMAND | MF_CHECKED);
MainWindow->checkMenu(IDM_SCREENSEP_BORDER, MF_BYCOMMAND | MF_UNCHECKED);
MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, MF_BYCOMMAND | MF_UNCHECKED);
UpdateWndRects(hwnd);
}
return 0; return 0;
case IDM_SCREENSEP_BORDER: case IDM_SCREENSEP_BORDER:
{ SetScreenGap(kGapBorder);
SetScreenGap(5);
MainWindow->checkMenu(IDM_SCREENSEP_NONE, MF_BYCOMMAND | MF_UNCHECKED);
MainWindow->checkMenu(IDM_SCREENSEP_BORDER, MF_BYCOMMAND | MF_CHECKED);
MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, MF_BYCOMMAND | MF_UNCHECKED);
UpdateWndRects(hwnd);
}
return 0; return 0;
case IDM_SCREENSEP_NDSGAP: case IDM_SCREENSEP_NDSGAP:
{ SetScreenGap(kGapNDS);
SetScreenGap(64);
MainWindow->checkMenu(IDM_SCREENSEP_NONE, MF_BYCOMMAND | MF_UNCHECKED);
MainWindow->checkMenu(IDM_SCREENSEP_BORDER, MF_BYCOMMAND | MF_UNCHECKED);
MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, MF_BYCOMMAND | MF_CHECKED);
UpdateWndRects(hwnd);
}
return 0; return 0;
case IDM_WEBSITE: case IDM_WEBSITE:
ShellExecute(NULL, "open", "http://desmume.sourceforge.net", NULL, NULL, SW_SHOWNORMAL); ShellExecute(NULL, "open", "http://desmume.sourceforge.net", NULL, NULL, SW_SHOWNORMAL);
@ -3665,7 +3665,7 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp)
{ {
case IDOK: case IDOK:
{ {
CommonSettings.HighResolutionInterpolateColor = IsDlgButtonChecked(hw,IDC_INTERPOLATECOLOR); CommonSettings.HighResolutionInterpolateColor = IsDlgCheckboxChecked(hw,IDC_INTERPOLATECOLOR);
NDS_3D_ChangeCore(ComboBox_GetCurSel(GetDlgItem(hw, IDC_3DCORE))); NDS_3D_ChangeCore(ComboBox_GetCurSel(GetDlgItem(hw, IDC_3DCORE)));
WritePrivateProfileInt("3D", "Renderer", cur3DCore, IniName); WritePrivateProfileInt("3D", "Renderer", cur3DCore, IniName);
WritePrivateProfileInt("3D", "HighResolutionInterpolateColor", CommonSettings.HighResolutionInterpolateColor?1:0, IniName); WritePrivateProfileInt("3D", "HighResolutionInterpolateColor", CommonSettings.HighResolutionInterpolateColor?1:0, IniName);
@ -3757,19 +3757,19 @@ LRESULT CALLBACK EmulationSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
HWND cur; HWND cur;
CommonSettings.UseExtBIOS = IsDlgButtonChecked(hDlg, IDC_USEEXTBIOS); CommonSettings.UseExtBIOS = IsDlgCheckboxChecked(hDlg, IDC_USEEXTBIOS);
cur = GetDlgItem(hDlg, IDC_ARM9BIOS); cur = GetDlgItem(hDlg, IDC_ARM9BIOS);
GetWindowText(cur, CommonSettings.ARM9BIOS, 256); GetWindowText(cur, CommonSettings.ARM9BIOS, 256);
cur = GetDlgItem(hDlg, IDC_ARM7BIOS); cur = GetDlgItem(hDlg, IDC_ARM7BIOS);
GetWindowText(cur, CommonSettings.ARM7BIOS, 256); GetWindowText(cur, CommonSettings.ARM7BIOS, 256);
CommonSettings.SWIFromBIOS = IsDlgButtonChecked(hDlg, IDC_BIOSSWIS); CommonSettings.SWIFromBIOS = IsDlgCheckboxChecked(hDlg, IDC_BIOSSWIS);
CommonSettings.UseExtFirmware = IsDlgButtonChecked(hDlg, IDC_USEEXTFIRMWARE); CommonSettings.UseExtFirmware = IsDlgCheckboxChecked(hDlg, IDC_USEEXTFIRMWARE);
cur = GetDlgItem(hDlg, IDC_FIRMWARE); cur = GetDlgItem(hDlg, IDC_FIRMWARE);
GetWindowText(cur, CommonSettings.Firmware, 256); GetWindowText(cur, CommonSettings.Firmware, 256);
CommonSettings.BootFromFirmware = IsDlgButtonChecked(hDlg, IDC_FIRMWAREBOOT); CommonSettings.BootFromFirmware = IsDlgCheckboxChecked(hDlg, IDC_FIRMWAREBOOT);
CommonSettings.DebugConsole = IsDlgButtonChecked(hDlg, IDC_CHECKBOX_DEBUGGERMODE); CommonSettings.DebugConsole = IsDlgCheckboxChecked(hDlg, IDC_CHECKBOX_DEBUGGERMODE);
WritePrivateProfileInt("Emulation", "DebugConsole", ((CommonSettings.DebugConsole == true) ? 1 : 0), IniName); WritePrivateProfileInt("Emulation", "DebugConsole", ((CommonSettings.DebugConsole == true) ? 1 : 0), IniName);
WritePrivateProfileInt("BIOS", "UseExtBIOS", ((CommonSettings.UseExtBIOS == true) ? 1 : 0), IniName); WritePrivateProfileInt("BIOS", "UseExtBIOS", ((CommonSettings.UseExtBIOS == true) ? 1 : 0), IniName);
@ -3879,7 +3879,7 @@ LRESULT CALLBACK MicrophoneSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam,
{ {
HWND cur; HWND cur;
UseMicSample = GetPrivateProfileInt("Use Mic Sample", "UseMicSample", FALSE, IniName); UseMicSample = GetPrivateProfileBool("Use Mic Sample", "UseMicSample", false, IniName);
CheckDlgButton(hDlg, IDC_USEMICSAMPLE, ((UseMicSample == true) ? BST_CHECKED : BST_UNCHECKED)); CheckDlgButton(hDlg, IDC_USEMICSAMPLE, ((UseMicSample == true) ? BST_CHECKED : BST_UNCHECKED));
GetPrivateProfileString("Use Mic Sample", "MicSampleFile", "micsample.raw", MicSampleName, MAX_PATH, IniName); GetPrivateProfileString("Use Mic Sample", "MicSampleFile", "micsample.raw", MicSampleName, MAX_PATH, IniName);
SetDlgItemText(hDlg, IDC_MICSAMPLE, MicSampleName); SetDlgItemText(hDlg, IDC_MICSAMPLE, MicSampleName);
@ -3906,7 +3906,7 @@ LRESULT CALLBACK MicrophoneSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam,
{ {
HWND cur; HWND cur;
UseMicSample = IsDlgButtonChecked(hDlg, IDC_USEMICSAMPLE); UseMicSample = IsDlgCheckboxChecked(hDlg, IDC_USEMICSAMPLE);
cur = GetDlgItem(hDlg, IDC_MICSAMPLE); cur = GetDlgItem(hDlg, IDC_MICSAMPLE);
GetWindowText(cur, MicSampleName, 256); GetWindowText(cur, MicSampleName, 256);

View File

@ -4,7 +4,7 @@
#include "CWindow.h" #include "CWindow.h"
extern WINCLASS *MainWindow; extern WINCLASS *MainWindow;
extern volatile BOOL execute, paused; extern volatile bool execute, paused;
void NDS_Pause(); void NDS_Pause();
void NDS_UnPause(); void NDS_UnPause();
void LoadSaveStateInfo(); void LoadSaveStateInfo();

View File

@ -35,7 +35,7 @@ struct mapview_struct
u32 autoup_secs; u32 autoup_secs;
bool autoup; bool autoup;
u16 map; u8 map;
u16 lcd; u16 lcd;
u16 bitmap[1024*1024]; u16 bitmap[1024*1024];
bool clear; bool clear;

View File

@ -362,7 +362,6 @@ BOOL CALLBACK MemView_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
{ {
FILE *f; FILE *f;
u8 memory[0x100]; u8 memory[0x100];
int line;
MMU_DumpMemBlock(data->cpu, data->address, 0x100, memory); MMU_DumpMemBlock(data->cpu, data->address, 0x100, memory);

View File

@ -90,7 +90,7 @@ waiter:
Sleep(100); Sleep(100);
return 1; return 1;
} }
Sleep(sleepy); Sleep((DWORD)sleepy);
goto waiter; goto waiter;
} }
if( (ttime-ltime) >= (tfreq*4/desiredfps)) if( (ttime-ltime) >= (tfreq*4/desiredfps))

View File

@ -138,7 +138,7 @@ LRESULT TileViewBox_Pal256(HWND hwnd, tileview_struct * win, WPARAM wParam, LPAR
if(win->pal) if(win->pal)
{ {
u32 i, num2, num, y, x; u32 num2, num, y, x;
u8* mem; u8* mem;
if(win->target >= ARM9MEM_LCDC) if(win->target >= ARM9MEM_LCDC)