Skip to content

Commit

Permalink
Merge pull request #18666 from Florin9doi/go_explore_navigation
Browse files Browse the repository at this point in the history
GPS: Improve emulation to enable Go!Explore navigation
  • Loading branch information
hrydgard committed Jan 6, 2024
2 parents 3b6a87b + 29fb746 commit 90ce29a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions Core/HLE/sceUsbGps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ static int sceUsbGpsGetState(u32 stateAddr) {
}

static int sceUsbGpsOpen() {
ERROR_LOG(HLE, "UNIMPL sceUsbGpsOpen");
GPS::init();
gpsStatus = GPS_STATE_ON;
System_GPSCommand("open");
return 0;
}

static int sceUsbGpsClose() {
ERROR_LOG(HLE, "UNIMPL sceUsbGpsClose");
gpsStatus = GPS_STATE_OFF;
System_GPSCommand("close");
return 0;
Expand Down Expand Up @@ -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);
}
}

Expand Down
6 changes: 3 additions & 3 deletions Core/HLE/sceUsbGps.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 90ce29a

Please sign in to comment.