2021-12-25 15:18:17 +00:00
|
|
|
/* ReC98
|
|
|
|
* -----
|
|
|
|
* Code segment #3 of TH02's MAINE.EXE
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "platform.h"
|
|
|
|
#include "master.hpp"
|
|
|
|
#include "th02/resident.hpp"
|
2022-03-12 22:11:04 +00:00
|
|
|
#include "th02/core/globals.hpp"
|
2021-12-25 15:18:17 +00:00
|
|
|
#include "th02/formats/cfg.h"
|
|
|
|
|
2023-03-25 19:05:28 +00:00
|
|
|
int cfg_load(void)
|
2021-12-25 15:18:17 +00:00
|
|
|
{
|
2023-06-27 20:10:47 +00:00
|
|
|
resident_t __seg *resident_seg;
|
2021-12-25 15:18:17 +00:00
|
|
|
|
|
|
|
file_ropen(CFG_FN);
|
|
|
|
file_seek(offsetof(cfg_t, resident), 0);
|
2023-06-27 20:10:47 +00:00
|
|
|
file_read(&resident_seg, sizeof(resident_seg));
|
2021-12-25 15:18:17 +00:00
|
|
|
file_close();
|
2023-06-27 20:10:47 +00:00
|
|
|
if(!resident_seg) {
|
2021-12-25 15:18:17 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2023-06-27 20:10:47 +00:00
|
|
|
resident = resident_seg;
|
2022-03-12 22:11:04 +00:00
|
|
|
lives = resident->rem_lives;
|
|
|
|
bombs = resident->rem_bombs;
|
2021-12-25 15:18:17 +00:00
|
|
|
rank = resident->rank;
|
|
|
|
score = resident->score;
|
|
|
|
return 1;
|
|
|
|
}
|