Fully implement settings persistence

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent 3d166abee4
commit 697ed5f58d
11 changed files with 62 additions and 64 deletions
+6
View File
@@ -61,5 +61,11 @@ export function saveProfile(buf: Buffer): SaveProfileRequest {
gauges: buf.readUInt16LE(0x0114),
music: buf.readUInt16LE(0x0140),
},
settings: {
music: buf.readUInt16LE(0x045a),
pack: buf.readUInt32LE(0x0034),
paperCup: buf.readUInt8(0x00f6),
gauges: buf.readUInt8(0x00f7),
},
};
}
+4 -11
View File
@@ -16,19 +16,12 @@ export function saveSettings(buf: Buffer): SaveSettingsRequest {
profileId: buf.readUInt32LE(0x0004) as Id<Profile>,
dpoint: buf.readUInt32LE(0x0008),
settings: {
bgMusic: buf.readUInt16LE(0x0002),
forceQuitEn: ((pack >> 0) & 1) !== 0,
steeringForce: (pack >> 1) & 15,
bgVolume: (pack >> 5) & 15,
seVolume: (pack >> 9) & 15,
cornerGuide: ((pack >> 13) & 1) !== 0,
lineGuide: ((pack >> 14) & 1) !== 0,
ghostEn: ((pack >> 15) & 1) !== 0,
taResultSkip: ((pack >> 16) & 1) !== 0,
music: buf.readUInt16LE(0x0002),
pack: buf.readUInt32LE(0x000c),
paperCup: buf.readUInt8(0x0011),
gauges: buf.readUInt8(0x0012),
},
field_0010: buf.readUInt8(0x0010),
field_0011: buf.readUInt8(0x0011),
field_0012: buf.readUInt8(0x0012), // always 5 for some reason
field_0013: buf.readUInt8(0x0013),
};
}