forked from porybox/pkparse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen6.js
26 lines (19 loc) · 767 Bytes
/
gen6.js
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
'use strict';
const common = require('./common');
exports.parseBuffer = (buf, {parseNames = false, language} = {}) => {
const data = common.parseBuffer(buf, {parseNames, language});
data.gen = 6;
data.idNo = data.tid;
const markingByte = buf.readUInt8(0x2a);
data.hasCircleMarking = !!(markingByte & 0x01);
data.hasTriangleMarking = !!(markingByte & 0x02);
data.hasSquareMarking = !!(markingByte & 0x04);
data.hasHeartMarking = !!(markingByte & 0x08);
data.hasStarMarking = !!(markingByte & 0x10);
data.hasDiamondMarking = !!(markingByte & 0x20);
data.language = [null, 'JPN', 'ENG', 'FRE', 'ITA', 'GER', '???', 'SPA', 'KOR'][buf.readUInt8(0xe3)];
if (parseNames) {
common.assignReadableNames(data, language);
}
return data;
};