\r
int MainWidth=720,MainHeight=480;\r
\r
-static HMENU mdisplay = 0, mpicohw = 0;\r
+static HMENU mmain = 0, mdisplay = 0, mpicohw = 0;\r
static int rom_loaded = 0;\r
\r
static void UpdateRect()\r
FrameRectMy = wi.rcClient;\r
}\r
\r
+static void PrepareFroROM()\r
+{\r
+ int show = PicoAHW & PAHW_PICO;\r
+ EnableMenuItem(mmain, 2, MF_BYPOSITION|(show ? MF_ENABLED : MF_GRAYED));\r
+ ShowWindow(PicoPadWnd, show ? SW_SHOWNA : SW_HIDE);\r
+ ShowWindow(PicoSwWnd, show ? SW_SHOWNA : SW_HIDE);\r
+ CheckMenuItem(mpicohw, 1210, show ? MF_CHECKED : MF_UNCHECKED);\r
+ CheckMenuItem(mpicohw, 1211, show ? MF_CHECKED : MF_UNCHECKED);\r
+ PostMessage(FrameWnd, WM_COMMAND, 1220 + PicoPicohw.page, 0);\r
+ DrawMenuBar(FrameWnd);\r
+\r
+ PicoPicohw.pen_pos[0] =\r
+ PicoPicohw.pen_pos[1] = 0x8000;\r
+ picohw_pen_pressed = 0;\r
+}\r
+\r
static void LoadROM(const char *cmdpath)\r
{\r
static char rompath[MAX_PATH] = { 0, };\r
PicoCartUnload();\r
PicoCartInsert(rom_data_new, rom_size);\r
\r
+ PrepareFroROM();\r
+\r
rom_loaded = 1;\r
romname = rompath;\r
LoopWait=0;\r
// Window proc for the frame window:\r
static LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam)\r
{\r
+ POINT pt;\r
+ RECT rc;\r
int i;\r
switch (msg)\r
{\r
return 0;\r
}\r
break;\r
+ case WM_TIMER:\r
+ GetCursorPos(&pt);\r
+ GetWindowRect(PicoSwWnd, &rc);\r
+ if (PtInRect(&rc, pt)) break;\r
+ GetWindowRect(PicoPadWnd, &rc);\r
+ if (PtInRect(&rc, pt)) break;\r
+ PicoPicohw.pen_pos[0] |= 0x8000;\r
+ PicoPicohw.pen_pos[1] |= 0x8000;\r
+ picohw_pen_pressed = 0;\r
+ break;\r
}\r
\r
return DefWindowProc(hwnd,msg,wparam,lparam);\r
{\r
case WM_CLOSE: return 0;\r
case WM_DESTROY: PicoSwWnd=NULL; break;\r
+ case WM_LBUTTONDOWN: picohw_pen_pressed = 1; return 0;\r
+ case WM_LBUTTONUP: picohw_pen_pressed = 0; return 0;\r
+ case WM_MOUSEMOVE:\r
+ PicoPicohw.pen_pos[0] = 0x03c + LOWORD(lparam) * 2/3;\r
+ PicoPicohw.pen_pos[1] = 0x2f8 + HIWORD(lparam);\r
+ SetTimer(FrameWnd, 100, 1000, NULL);\r
+ break;\r
}\r
\r
return DefWindowProc(hwnd,msg,wparam,lparam);\r
{\r
case WM_CLOSE: return 0;\r
case WM_DESTROY: PicoPadWnd=NULL; break;\r
+ case WM_LBUTTONDOWN: picohw_pen_pressed = 1; return 0;\r
+ case WM_LBUTTONUP: picohw_pen_pressed = 0; return 0;\r
+ case WM_MOUSEMOVE:\r
+ PicoPicohw.pen_pos[0] = 0x03c + LOWORD(lparam);\r
+ PicoPicohw.pen_pos[1] = 0x1fc + HIWORD(lparam);\r
+ SetTimer(FrameWnd, 100, 1000, NULL);\r
+ break;\r
}\r
\r
return DefWindowProc(hwnd,msg,wparam,lparam);\r
{\r
WNDCLASS wc;\r
RECT rect={0,0,0,0};\r
- HMENU mmain, mfile;\r
+ HMENU mfile;\r
int style=0;\r
int left=0,top=0,width=0,height=0;\r
\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
+ EnableMenuItem(mmain, 2, MF_BYPOSITION|MF_GRAYED);\r
// InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, 1200, "&Config");\r
InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING, 1300, "&About");\r
\r
\r
left += 326;\r
PicoSwWnd=CreateWindow("PicoSwWnd","Storyware",style,\r
- left,top,width,height,FrameWnd,NULL,NULL,NULL);\r
+ left,top,width+160,height,FrameWnd,NULL,NULL,NULL);\r
\r
top += 266;\r
PicoPadWnd=CreateWindow("PicoPadWnd","Drawing Pad",style,\r