ppsspp/Core/HLE/sceUsbGps.h
Florin9doi 83277680da Location: add HDOP; change speed to km/h; change altitude from geoid to sea level
The speed is now close to the value obtained on original hardware but
the altitude on original hardawre is too imprecise to tell if we're good
2020-01-26 14:19:45 +02:00

73 lines
1.8 KiB
C++

// Copyright (c) 2012- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include "Core/HLE/FunctionWrappers.h"
void Register_sceUsbGps();
void __UsbGpsInit();
void __UsbGpsDoState(PointerWrap &p);
void __UsbGpsShutdown();
#pragma pack(push, 1)
typedef struct {
short year;
short month;
short date;
short hour;
short minute;
short second;
float garbage1;
float hdop;
float garbage2;
float latitude;
float longitude;
float altitude;
float garbage3;
float speed;
float bearing;
} GpsData;
typedef struct {
unsigned char id;
unsigned char elevation;
short azimuth;
unsigned char snr;
unsigned char good;
short garbage;
} SatInfo;
typedef struct {
short satellites_in_view;
short garbage;
SatInfo satInfo[24];
} SatData;
#pragma pack(pop)
namespace GPS {
void init();
void setGpsTime(time_t *time);
void setGpsData(long long time, float hdop, float latitude, float longitude, float altitude, float speed, float bearing);
void setSatInfo(short index, unsigned char id, unsigned char elevation, short azimuth, unsigned char snr, unsigned char good);
GpsData *getGpsData();
SatData *getSatData();
}