generated from 32blit/32blit-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
save.hpp
40 lines (31 loc) · 720 Bytes
/
save.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <cstdint>
enum class SaveType {
RaceResult = 0,
TimeTrial = 1,
UserData = 0xF
};
inline int get_save_slot(SaveType type, int track, int slot = 0) {
return (static_cast<int>(type) << 12) | (track << 4) | slot;
}
struct RaceSaveData {
uint8_t save_version = 1;
uint8_t place;
uint16_t time; // ms/10
};
struct TimeTrialSaveData {
uint8_t save_version = 1;
uint8_t kart = 0;
uint16_t lap_time[3];
char name[8]{0};
struct {
int16_t pos_x, pos_z;
int16_t look_ang;
uint16_t pad; // hmm
} ghost_data[4096];
uint16_t ghost_data_used = 0;
};
struct UserSaveData {
uint8_t save_version = 1;
char name[8]{0};
};