• R/O
  • SSH
  • HTTPS

oswan: Commit


Commit MetaInfo

Revision91 (tree)
Time2010-05-12 19:02:18
Authorbird_may_nike

Log Message

(empty log message)

Change Summary

Incremental Difference

--- oswanj/trunk/src/WSMain.cpp (revision 90)
+++ oswanj/trunk/src/WSMain.cpp (revision 91)
@@ -29,7 +29,8 @@
2929 static wchar_t RecentOfn2[512];
3030 static wchar_t RecentOfn3[512];
3131 static wchar_t RecentOfn4[512];
32-static wchar_t* RecentOfn[5] = {RecentOfn0, RecentOfn1, RecentOfn2, RecentOfn3, RecentOfn4};
32+static wchar_t RecentOfn5[512];
33+wchar_t* RecentOfn[] = {RecentOfn0, RecentOfn1, RecentOfn2, RecentOfn3, RecentOfn4, RecentOfn5};
3334
3435 int WINAPI WinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst, LPSTR lpsCmdLine, int nCmdShow)
3536 {
@@ -49,6 +50,7 @@
4950 WsSetDir();
5051 WsLoadIEep();
5152 ConfigCreate();
53+ SetRecentRoms(NULL);
5254 apuInit();
5355 apuLoadSound();
5456 drawInitialize(FALSE);
@@ -143,13 +145,19 @@
143145 }
144146 return 0L;
145147 case ID_FILE_RECENT0:
146- if (*RecentOfn[0])
148+ case ID_FILE_RECENT1:
149+ case ID_FILE_RECENT2:
150+ case ID_FILE_RECENT3:
151+ case ID_FILE_RECENT4:
152+ case ID_FILE_RECENT5:
153+ id = LOWORD(wp) - ID_FILE_RECENT0;
154+ if (*RecentOfn[id])
147155 {
148156 apuWaveClear();
149157 WsRelease();
150158 Run = 1;
151- WsCreate(RecentOfn[0]);
152- SetRecentRoms(RecentOfn[0]);
159+ WsCreate(RecentOfn[id]);
160+ SetRecentRoms(RecentOfn[id]);
153161 }
154162 return 0L;
155163 case ID_PDATA_SET:
@@ -400,7 +408,7 @@
400408
401409 if (RomPath && *RomPath)
402410 {
403- for (i = 0; i < 5; i++)
411+ for (i = 0; i < 6; i++)
404412 {
405413 if (wcscmp(RomPath, RecentOfn[i]) == 0)
406414 {
@@ -415,7 +423,8 @@
415423 }
416424 if (i)
417425 {
418- temp = RecentOfn[4];
426+ temp = RecentOfn[5];
427+ RecentOfn[5] = RecentOfn[4];
419428 RecentOfn[4] = RecentOfn[3];
420429 RecentOfn[3] = RecentOfn[2];
421430 RecentOfn[2] = RecentOfn[1];
@@ -425,7 +434,7 @@
425434 }
426435 }
427436 HMENU menu = GetMenu(hWnd);
428- for (i = 0; i < 5; i++)
437+ for (i = 0; i < 6; i++)
429438 {
430439 if (*RecentOfn[i])
431440 {
--- oswanj/trunk/src/WSConfig.cpp (revision 90)
+++ oswanj/trunk/src/WSConfig.cpp (revision 91)
@@ -9,6 +9,7 @@
99 #include "WSInput.h"
1010 #include "WSFileio.h"
1111
12+extern wchar_t* RecentOfn[];
1213 static LPCWSTR KeyName[] = {
1314 L"B", L"A", L"START", L"OPTION",
1415 L"X4", L"X3", L"X2", L"X1",
@@ -78,20 +79,26 @@
7879
7980 for (i = 12; i >= 0; i--)
8081 {
81- WsKeyboardH[i] = GetPrivateProfileIntW(L"KEY_H", KeyName[i] , WsKeyboardH[i] , IniPath);
82+ WsKeyboardH[i] = GetPrivateProfileIntW(L"KEY_H", KeyName[i], WsKeyboardH[i], IniPath);
8283 }
8384 for (i = 12; i >= 0; i--)
8485 {
85- WsKeyboardV[i] = GetPrivateProfileIntW(L"KEY_V", KeyName[i] , WsKeyboardV[i] , IniPath);
86+ WsKeyboardV[i] = GetPrivateProfileIntW(L"KEY_V", KeyName[i], WsKeyboardV[i], IniPath);
8687 }
8788 for (i = 12; i >= 0; i--)
8889 {
89- WsJoypadH[i] = GetPrivateProfileIntW(L"JOY_H", KeyName[i] , WsJoypadH[i] , IniPath);
90+ WsJoypadH[i] = GetPrivateProfileIntW(L"JOY_H", KeyName[i], WsJoypadH[i], IniPath);
9091 }
9192 for (i = 12; i >= 0; i--)
9293 {
93- WsJoypadV[i] = GetPrivateProfileIntW(L"JOY_V", KeyName[i] , WsJoypadV[i] , IniPath);
94+ WsJoypadV[i] = GetPrivateProfileIntW(L"JOY_V", KeyName[i], WsJoypadV[i], IniPath);
9495 }
96+ GetPrivateProfileStringW(L"RECENT_ROMS", L"0", L"", RecentOfn[0], 512, IniPath);
97+ GetPrivateProfileStringW(L"RECENT_ROMS", L"1", L"", RecentOfn[1], 512, IniPath);
98+ GetPrivateProfileStringW(L"RECENT_ROMS", L"2", L"", RecentOfn[2], 512, IniPath);
99+ GetPrivateProfileStringW(L"RECENT_ROMS", L"3", L"", RecentOfn[3], 512, IniPath);
100+ GetPrivateProfileStringW(L"RECENT_ROMS", L"4", L"", RecentOfn[4], 512, IniPath);
101+ GetPrivateProfileStringW(L"RECENT_ROMS", L"5", L"", RecentOfn[5], 512, IniPath);
95102 }
96103
97104 static void WritePrivateProfileIntW(LPCWSTR lpAppName, LPCWSTR lpKeyName, int nInt, LPCWSTR lpFileName)
@@ -108,18 +115,24 @@
108115
109116 for (i = 12; i >= 0; i--)
110117 {
111- WritePrivateProfileIntW(L"KEY_H", KeyName[i] , WsKeyboardH[i] , IniPath);
118+ WritePrivateProfileIntW(L"KEY_H", KeyName[i], WsKeyboardH[i], IniPath);
112119 }
113120 for (i = 12; i >= 0; i--)
114121 {
115- WritePrivateProfileIntW(L"KEY_V", KeyName[i] , WsKeyboardV[i] , IniPath);
122+ WritePrivateProfileIntW(L"KEY_V", KeyName[i], WsKeyboardV[i], IniPath);
116123 }
117124 for (i = 12; i >= 0; i--)
118125 {
119- WritePrivateProfileIntW(L"JOY_H", KeyName[i] , WsJoypadH[i] , IniPath);
126+ WritePrivateProfileIntW(L"JOY_H", KeyName[i], WsJoypadH[i], IniPath);
120127 }
121128 for (i = 12; i >= 0; i--)
122129 {
123- WritePrivateProfileIntW(L"JOY_V", KeyName[i] , WsJoypadV[i] , IniPath);
130+ WritePrivateProfileIntW(L"JOY_V", KeyName[i], WsJoypadV[i], IniPath);
124131 }
132+ WritePrivateProfileStringW(L"RECENT_ROMS", L"0", RecentOfn[0], IniPath);
133+ WritePrivateProfileStringW(L"RECENT_ROMS", L"1", RecentOfn[1], IniPath);
134+ WritePrivateProfileStringW(L"RECENT_ROMS", L"2", RecentOfn[2], IniPath);
135+ WritePrivateProfileStringW(L"RECENT_ROMS", L"3", RecentOfn[3], IniPath);
136+ WritePrivateProfileStringW(L"RECENT_ROMS", L"4", RecentOfn[4], IniPath);
137+ WritePrivateProfileStringW(L"RECENT_ROMS", L"5", RecentOfn[5], IniPath);
125138 }
--- oswanj/trunk/resource.h (revision 90)
+++ oswanj/trunk/resource.h (revision 91)
@@ -55,6 +55,7 @@
5555 #define ID_FILE_RECENT2 40037
5656 #define ID_FILE_RECENT3 40038
5757 #define ID_FILE_RECENT4 40039
58+#define ID_FILE_RECENT5 40040
5859
5960 // Next default values for new objects
6061 //
@@ -61,7 +62,7 @@
6162 #ifdef APSTUDIO_INVOKED
6263 #ifndef APSTUDIO_READONLY_SYMBOLS
6364 #define _APS_NEXT_RESOURCE_VALUE 109
64-#define _APS_NEXT_COMMAND_VALUE 40040
65+#define _APS_NEXT_COMMAND_VALUE 40041
6566 #define _APS_NEXT_CONTROL_VALUE 1016
6667 #define _APS_NEXT_SYMED_VALUE 101
6768 #endif
Show on old repository browser