HWND FrameWnd=NULL;\r
RECT FrameRectMy;\r
int lock_to_1_1 = 1;\r
+static HWND PicoSwWnd=NULL, PicoPadWnd=NULL;\r
\r
int MainWidth=720,MainHeight=480;\r
\r
-static HMENU mdisplay = 0;\r
+static HMENU mdisplay = 0, mpicohw = 0;\r
static int rom_loaded = 0;\r
\r
static void UpdateRect()\r
LoopWait=1;\r
for (i = 0; LoopWaiting == 0 && i < 10; i++) Sleep(100);\r
\r
- PicoUnloadCart();\r
+ PicoCartUnload();\r
PicoCartInsert(rom_data_new, rom_size);\r
\r
rom_loaded = 1;\r
switch (LOWORD(wparam))\r
{\r
case 1000: LoadROM(NULL); break;\r
- case 1001: PostQuitMessage(0); return 0;\r
+ case 1001: PicoReset(); return 0;\r
+ case 1002: PostQuitMessage(0); return 0;\r
case 1100:\r
case 1101:\r
case 1102:\r
lock_to_1_1=!lock_to_1_1;\r
CheckMenuItem(mdisplay, 1104, lock_to_1_1 ? MF_CHECKED : MF_UNCHECKED);\r
return 0;\r
- case 1200: break;\r
+ case 1210:\r
+ case 1211:\r
+ i = IsWindowVisible((LOWORD(wparam)&1) ? PicoPadWnd : PicoSwWnd);\r
+ i = !i;\r
+ ShowWindow((LOWORD(wparam)&1) ? PicoPadWnd : PicoSwWnd, i ? SW_SHOWNA : SW_HIDE);\r
+ CheckMenuItem(mpicohw, LOWORD(wparam), i ? MF_CHECKED : MF_UNCHECKED);\r
+ return 0;\r
+ case 1220:\r
+ case 1221:\r
+ case 1222:\r
+ case 1223:\r
+ case 1224:\r
+ case 1225:\r
+ case 1226:\r
+ PicoPicohw.page = LOWORD(wparam) % 10;\r
+ for (i = 0; i < 7; i++)\r
+ CheckMenuItem(mpicohw, 1220 + i, MF_UNCHECKED);\r
+ CheckMenuItem(mpicohw, 1220 + PicoPicohw.page, MF_CHECKED);\r
+ return 0;\r
case 1300:\r
MessageBox(FrameWnd, "PicoDrive v" VERSION " (c) notaz, 2006-2008\n"\r
- "SVP demo edition\n\n"\r
+ "SVP and Pico demo edition\n\n"\r
"Credits:\n"\r
"fDave: base code of PicoDrive, GenaDrive (the frontend)\n"\r
"Chui: Fame/C\n"\r
return DefWindowProc(hwnd,msg,wparam,lparam);\r
}\r
\r
+static LRESULT CALLBACK PicoSwWndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam)\r
+{\r
+ switch (msg)\r
+ {\r
+ case WM_CLOSE: return 0;\r
+ case WM_DESTROY: PicoSwWnd=NULL; break;\r
+ }\r
+\r
+ return DefWindowProc(hwnd,msg,wparam,lparam);\r
+}\r
+\r
+static LRESULT CALLBACK PicoPadWndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam)\r
+{\r
+ switch (msg)\r
+ {\r
+ case WM_CLOSE: return 0;\r
+ case WM_DESTROY: PicoPadWnd=NULL; break;\r
+ }\r
+\r
+ return DefWindowProc(hwnd,msg,wparam,lparam);\r
+}\r
+\r
+\r
static int FrameInit()\r
{\r
WNDCLASS wc;\r
wc.hInstance=GetModuleHandle(NULL);\r
wc.hCursor=LoadCursor(NULL,IDC_ARROW);\r
wc.hbrBackground=CreateSolidBrush(0);\r
- wc.lpszClassName="MainFrame";\r
+ wc.lpszClassName="PicoMainFrame";\r
+ RegisterClass(&wc);\r
+\r
+ wc.lpszClassName="PicoSwWnd";\r
+ wc.lpfnWndProc=PicoSwWndProc;\r
+ RegisterClass(&wc);\r
+\r
+ wc.lpszClassName="PicoPadWnd";\r
+ wc.lpfnWndProc=PicoPadWndProc;\r
RegisterClass(&wc);\r
\r
rect.right =320;//MainWidth;\r
// Create menu:\r
mfile = CreateMenu();\r
InsertMenu(mfile, -1, MF_BYPOSITION|MF_STRING, 1000, "&Load ROM");\r
- InsertMenu(mfile, -1, MF_BYPOSITION|MF_STRING, 1001, "E&xit");\r
+ InsertMenu(mfile, -1, MF_BYPOSITION|MF_STRING, 1001, "&Reset");\r
+ InsertMenu(mfile, -1, MF_BYPOSITION|MF_STRING, 1002, "E&xit");\r
mdisplay = CreateMenu();\r
InsertMenu(mdisplay, -1, MF_BYPOSITION|MF_STRING, 1100, "320x224");\r
InsertMenu(mdisplay, -1, MF_BYPOSITION|MF_STRING, 1101, "256x224");\r
InsertMenu(mdisplay, -1, MF_BYPOSITION|MF_STRING, 1102, "640x448");\r
InsertMenu(mdisplay, -1, MF_BYPOSITION|MF_STRING, 1103, "512x448");\r
InsertMenu(mdisplay, -1, MF_BYPOSITION|MF_STRING, 1104, "Lock to 1:1");\r
+ mpicohw = CreateMenu();\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1210, "Show &Storyware");\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1211, "Show &Drawing pad");\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_SEPARATOR, 0, NULL);\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1220, "Title page (&0)");\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1221, "Page &1");\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1222, "Page &2");\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1223, "Page &3");\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1224, "Page &4");\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1225, "Page &5");\r
+ InsertMenu(mpicohw, -1, MF_BYPOSITION|MF_STRING, 1226, "Page &6");\r
mmain = CreateMenu();\r
- InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, (UINT_PTR) mfile, "&File");\r
+ InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, (UINT_PTR) mfile, "&File");\r
InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, (UINT_PTR) mdisplay, "&Display");\r
+ InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, (UINT_PTR) mpicohw, "&Pico");\r
// InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, 1200, "&Config");\r
InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING, 1300, "&About");\r
\r
// Create the window:\r
- FrameWnd=CreateWindow(wc.lpszClassName,"PicoDrive " VERSION,style|WS_VISIBLE,\r
+ FrameWnd=CreateWindow("PicoMainFrame","PicoDrive " VERSION,style|WS_VISIBLE,\r
left,top,width,height,NULL,mmain,NULL,NULL);\r
\r
CheckMenuItem(mdisplay, 1104, lock_to_1_1 ? MF_CHECKED : MF_UNCHECKED);\r
UpdateWindow(FrameWnd);\r
UpdateRect();\r
\r
+ // create Pico windows\r
+ style = WS_OVERLAPPED|WS_CAPTION|WS_BORDER;\r
+ rect.left=rect.top=0;\r
+ rect.right =320;\r
+ rect.bottom=224;\r
+\r
+ AdjustWindowRect(&rect,style,1);\r
+ width =rect.right-rect.left;\r
+ height=rect.bottom-rect.top;\r
+\r
+ left += 326;\r
+ PicoSwWnd=CreateWindow("PicoSwWnd","Storyware",style,\r
+ left,top,width,height,FrameWnd,NULL,NULL,NULL);\r
+\r
+ top += 266;\r
+ PicoPadWnd=CreateWindow("PicoPadWnd","Drawing Pad",style,\r
+ left,top,width,height,FrameWnd,NULL,NULL,NULL);\r
+\r
return 0;\r
}\r
\r