GPS: Improve emulation to enable Go!Explore navigation

This commit is contained in:
Florin9doi 2024-01-05 11:21:52 +02:00
parent 1f8191ec9b
commit 29fb746ef8
2 changed files with 9 additions and 10 deletions

View file

@ -67,7 +67,6 @@ static int sceUsbGpsGetState(u32 stateAddr) {
}
static int sceUsbGpsOpen() {
ERROR_LOG(HLE, "UNIMPL sceUsbGpsOpen");
GPS::init();
gpsStatus = GPS_STATE_ON;
System_GPSCommand("open");
@ -75,7 +74,6 @@ static int sceUsbGpsOpen() {
}
static int sceUsbGpsClose() {
ERROR_LOG(HLE, "UNIMPL sceUsbGpsClose");
gpsStatus = GPS_STATE_OFF;
System_GPSCommand("close");
return 0;
@ -131,14 +129,15 @@ void GPS::init() {
gpsData.altitude = 19.0f;
gpsData.speed = 3.0f;
gpsData.bearing = 35.0f;
gpsData.garbage2 = 513;
satData.satellites_in_view = 6;
satData.satellites_in_view = 12;
for (unsigned char i = 0; i < satData.satellites_in_view; i++) {
satData.satInfo[i].id = i + 1; // 1 .. 32
satData.satInfo[i].elevation = i * 10;
satData.satInfo[i].azimuth = i * 50;
satData.satInfo[i].snr = 0;
satData.satInfo[i].good = 1;
satData.satInfo[i].elevation = 20;
satData.satInfo[i].azimuth = i * (360/satData.satellites_in_view);
satData.satInfo[i].snr = 45;
satData.satInfo[i].good = !!(i % 3);
}
}

View file

@ -36,12 +36,12 @@ typedef struct {
short second;
float garbage1;
float hdop;
float garbage2;
u32 garbage2; // 0 > 257 > 513
float latitude;
float longitude;
float altitude;
float altitude; // m
float garbage3;
float speed;
float speed; // km/h
float bearing;
} GpsData;