Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPS: Improve emulation to enable Go!Explore navigation #18666

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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