Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cycle frame color #80

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified miku/paintings/room-203.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 17 additions & 1 deletion src/ST47T.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,22 @@ const updateRoom203 = (bin: Buffer, pngPath: string) => {
const pngData = readFileSync(pngPath);

const imgOfs = 0x29800;
const pal: number[] = [];
const pal: number[] = [
54262, 55216, 56111, 57113, 56280, 56913, 57036, 59960, 61940, 62235, 65535,
60790, 59068, 63005, 62644, 62844,
];

// 1 purple
// 7 darkish purple
// 9 dark green
// 10 dark grey
// 11 light green
const actualShifts = 7;
for (let i = 0; i < actualShifts; i++) {
// Remove the last element and insert it at the start
pal.unshift(pal.pop() as number);
}

const encodedLogo = encodeCutSceneTexture(pal, pngData);
const mpTexture = decompress(Buffer.from(bin.subarray(imgOfs)));

Expand All @@ -147,6 +162,7 @@ const updateRoom203 = (bin: Buffer, pngPath: string) => {
// Update Palette
const palOfs = 0x2f800;
const red = encodeTexel(255, 0, 0, 255);

for (let i = 0; i < pal.length; i++) {
bin.writeUInt16LE(pal[i], palOfs + 0x30 + i * 2);
// bin.writeUInt16LE(red, palOfs + 0x30 + i * 2);
Expand Down