1 // Copyright (c) 2012- PPSSPP Project.
2 
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, version 2.0 or later versions.
6 
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 // GNU General Public License 2.0 for more details.
11 
12 // A copy of the GPL 2.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
14 
15 // Official git repository and contact information can be found at
16 // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17 
18 #pragma once
19 
20 #include "Core/HLE/FunctionWrappers.h"
21 
22 void Register_sceUsbGps();
23 
24 void __UsbGpsInit();
25 void __UsbGpsDoState(PointerWrap &p);
26 void __UsbGpsShutdown();
27 
28 #pragma pack(push, 1)
29 
30 typedef struct {
31 	short year;
32 	short month;
33 	short date;
34 	short hour;
35 	short minute;
36 	short second;
37 	float garbage1;
38 	float hdop;
39 	float garbage2;
40 	float latitude;
41 	float longitude;
42 	float altitude;
43 	float garbage3;
44 	float speed;
45 	float bearing;
46 } GpsData;
47 
48 typedef struct {
49 	unsigned char   id;
50 	unsigned char   elevation;
51 	short           azimuth;
52 	unsigned char   snr;
53 	unsigned char   good;
54 	short           garbage;
55 } SatInfo;
56 
57 typedef struct {
58 	short satellites_in_view;
59 	short garbage;
60 	SatInfo satInfo[24];
61 } SatData;
62 
63 #pragma pack(pop)
64 
65 namespace GPS {
66 	void init();
67 	void setGpsTime(time_t *time);
68 	void setGpsData(long long time, float hdop, float latitude, float longitude, float altitude, float speed, float bearing);
69 	void setSatInfo(short index, unsigned char id, unsigned char elevation, short azimuth, unsigned char snr, unsigned char good);
70 	GpsData *getGpsData();
71 	SatData *getSatData();
72 }
73