mirror of
https://github.com/izzy2lost/libultraship.git
synced 2026-06-19 01:16:13 -07:00
obey app directory for default.sav (#908)
This commit is contained in:
@@ -10,7 +10,8 @@ int32_t osEepromLongRead(OSMesgQueue* mq, uint8_t address, uint8_t* buffer, int3
|
||||
u8 content[512];
|
||||
s32 ret = -1;
|
||||
|
||||
FILE* fp = fopen("default.sav", "rb");
|
||||
const std::string save_file = Ship::Context::GetPathRelativeToAppDirectory("default.sav");
|
||||
FILE* fp = fopen(save_file.c_str(), "rb");
|
||||
if (fp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
@@ -34,7 +35,8 @@ int32_t osEepromLongWrite(OSMesgQueue* mq, uint8_t address, uint8_t* buffer, int
|
||||
}
|
||||
memcpy(content + address * 8, buffer, length);
|
||||
|
||||
FILE* fp = fopen("default.sav", "wb");
|
||||
const std::string save_file = Ship::Context::GetPathRelativeToAppDirectory("default.sav");
|
||||
FILE* fp = fopen(save_file.c_str(), "wb");
|
||||
if (fp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
@@ -46,4 +48,4 @@ int32_t osEepromLongWrite(OSMesgQueue* mq, uint8_t address, uint8_t* buffer, int
|
||||
int32_t osEepromWrite(OSMesgQueue* mq, uint8_t address, uint8_t* buffer) {
|
||||
return osEepromLongWrite(mq, address, buffer, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user