1 /**********************************************************************
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful but, except
10 * as otherwise stated in writing, without any warranty; without even the
11 * implied warranty of merchantability or fitness for a particular purpose.
12 * See the GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
21 * Contact Information:
22 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25 ******************************************************************************/
27 #include "img_types.h"
28 #include "pvr_debug.h"
34 u32 g_ui32HotKeyFrame = 0xFFFFFFFF;
35 IMG_BOOL g_bHotKeyPressed = IMG_FALSE;
36 IMG_BOOL g_bHotKeyRegistered = IMG_FALSE;
38 struct PRIVATEHOTKEYDATA g_PrivateHotKeyData;
40 void ReadInHotKeys(void)
42 g_PrivateHotKeyData.ui32ScanCode = 0x58;
43 g_PrivateHotKeyData.ui32ShiftState = 0x0;
45 HostReadRegistryDWORDFromString("DEBUG\\Streams", "ui32ScanCode",
46 &g_PrivateHotKeyData.ui32ScanCode);
47 HostReadRegistryDWORDFromString("DEBUG\\Streams", "ui32ShiftState",
48 &g_PrivateHotKeyData.ui32ShiftState);
51 void RegisterKeyPressed(u32 dwui32ScanCode, struct HOTKEYINFO *pInfo)
53 struct DBG_STREAM *psStream;
55 PVR_UNREFERENCED_PARAMETER(pInfo);
57 if (dwui32ScanCode == g_PrivateHotKeyData.ui32ScanCode) {
58 PVR_DPF(PVR_DBG_MESSAGE, "PDUMP Hotkey pressed !\n");
60 psStream = (struct DBG_STREAM *)
61 g_PrivateHotKeyData.sHotKeyInfo.pvStream;
63 if (!g_bHotKeyPressed) {
65 g_ui32HotKeyFrame = psStream->ui32Current + 2;
67 g_bHotKeyPressed = IMG_TRUE;
72 void ActivateHotKeys(struct DBG_STREAM *psStream)
77 if (!g_PrivateHotKeyData.sHotKeyInfo.hHotKey)
78 if (g_PrivateHotKeyData.ui32ScanCode != 0) {
79 PVR_DPF(PVR_DBG_MESSAGE,
80 "Activate HotKey for PDUMP.\n");
82 g_PrivateHotKeyData.sHotKeyInfo.pvStream = psStream;
84 DefineHotKey(g_PrivateHotKeyData.ui32ScanCode,
85 g_PrivateHotKeyData.ui32ShiftState,
86 &g_PrivateHotKeyData.sHotKeyInfo);
88 g_PrivateHotKeyData.sHotKeyInfo.hHotKey = 0;
92 void DeactivateHotKeys(void)
94 if (g_PrivateHotKeyData.sHotKeyInfo.hHotKey != 0) {
95 PVR_DPF(PVR_DBG_MESSAGE, "Deactivate HotKey.\n");
97 RemoveHotKey(g_PrivateHotKeyData.sHotKeyInfo.hHotKey);
98 g_PrivateHotKeyData.sHotKeyInfo.hHotKey = 0;