PCem
view src/win-status.c @ 133:24b744b9a632
ViRGE S3D triangle rendering now uses worker thread.
Fixed clipping bug on ViRGE.
Fixed status window crash.
| author | TomW |
|---|---|
| date | Tue Jul 22 21:10:39 2014 +0100 |
| parents | 0aa71a22757b |
| children |
line source
1 #define BITMAP WINDOWS_BITMAP
2 #include <windows.h>
3 #include <windowsx.h>
4 #undef BITMAP
6 #include "ibm.h"
7 #include "device.h"
8 #include "video.h"
9 #include "resources.h"
10 #include "win.h"
12 HWND status_hwnd;
13 int status_is_open = 0;
15 extern int sreadlnum, swritelnum, segareads, segawrites, scycles_lost;
16 static BOOL CALLBACK status_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
17 {
18 char device_s[4096];
19 switch (message)
20 {
21 case WM_INITDIALOG:
22 status_is_open = 1;
23 case WM_USER:
24 sprintf(device_s,
25 "CPU speed : %f MIPS\n"
26 "FPU speed : %f MFLOPS\n\n"
27 "Cache misses (read) : %i/sec\n"
28 "Cache misses (write) : %i/sec\n\n"
29 "Video throughput (read) : %i bytes/sec\n"
30 "Video throughput (write) : %i bytes/sec\n\n"
31 "Effective clockspeed : %iHz\n\n"
32 "Timer 0 frequency : %fHz\n\n",
33 mips,
34 flops,
35 sreadlnum,
36 swritelnum,
37 segareads,
38 segawrites,
39 clockrate - (sreadlnum*memwaitstate) - (swritelnum*memwaitstate) - scycles_lost,
40 pit_timer0_freq()
41 );
43 device_add_status_info(device_s, 4096);
44 SendDlgItemMessage(hdlg, IDC_STEXT_DEVICE, WM_SETTEXT, (WPARAM)NULL, (LPARAM)device_s);
45 return TRUE;
47 case WM_COMMAND:
48 switch (LOWORD(wParam))
49 {
50 case IDOK:
51 case IDCANCEL:
52 status_is_open = 0;
53 EndDialog(hdlg, 0);
54 return TRUE;
55 }
56 break;
57 }
59 return FALSE;
60 }
62 void status_open(HWND hwnd)
63 {
64 status_hwnd = CreateDialog(hinstance, TEXT("StatusDlg"), hwnd, status_dlgproc);
65 ShowWindow(status_hwnd, SW_SHOW);
66 }
