SprPoP: HDD-раскладка и пути от каталога EXE
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "pop_cheat.h"
|
||||
#include "pop_sfx.h"
|
||||
#include "_pop_config.h"
|
||||
#include "_pop_file.h"
|
||||
|
||||
#define CFG_BASE 0x100
|
||||
|
||||
@@ -151,7 +152,7 @@ static uint8_t cfg_read_file(uint8_t *buf, uint16_t *size)
|
||||
int fd, got;
|
||||
long n;
|
||||
|
||||
fd = open("POP.CFG", O_RDONLY);
|
||||
POP_PATH_CALL(fd, open("POP.CFG", O_RDONLY));
|
||||
if (fd < 0) return 0;
|
||||
n = lseek(fd, 0, SEEK_END);
|
||||
if (n < POP_CFG_MIN_SIZE || n > POP_CFG_MAX_SIZE ||
|
||||
@@ -172,7 +173,7 @@ int8_t pop_cfg_load(void) __banked
|
||||
|
||||
if (!cfg_read_file(buf, &size) || !pop_cfg_decode(buf, size)) return 0;
|
||||
if (buf[9] != POP_PROFILE_VANILLA)
|
||||
printf("POP.CFG: ENHANCED profile -> VANILLA\n");
|
||||
puts("POP.CFG: ENHANCED profile -> VANILLA\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -192,7 +193,7 @@ int8_t pop_cfg_save(void) __banked
|
||||
gfx_w0_unmap();
|
||||
/* Не unlink: bank_save_file сам делает O_TRUNC и не создаёт лишнего
|
||||
* окна, когда POP.CFG вообще отсутствует после ошибки unlink. */
|
||||
rc = bank_save_file(page, CFG_BASE, "POP.CFG", sizeof(buf));
|
||||
POP_PATH_CALL(rc, bank_save_file(page, CFG_BASE, "POP.CFG", sizeof(buf)));
|
||||
mem_free_block(blk);
|
||||
return (rc == sizeof(buf)) ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user