From 29fb746ef88be72cf143c5f96272cf807617f10b Mon Sep 17 00:00:00 2001 From: Florin9doi Date: Fri, 5 Jan 2024 11:21:52 +0200 Subject: [PATCH] GPS: Improve emulation to enable Go!Explore navigation --- Core/HLE/sceUsbGps.cpp | 13 ++++++------- Core/HLE/sceUsbGps.h | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Core/HLE/sceUsbGps.cpp b/Core/HLE/sceUsbGps.cpp index fe9fdf66d5b8..5aa8ec913909 100644 --- a/Core/HLE/sceUsbGps.cpp +++ b/Core/HLE/sceUsbGps.cpp @@ -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); } } diff --git a/Core/HLE/sceUsbGps.h b/Core/HLE/sceUsbGps.h index 39513cda7158..2e6e4722a223 100644 --- a/Core/HLE/sceUsbGps.h +++ b/Core/HLE/sceUsbGps.h @@ -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;