Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
This is a module to simplify all kinds of tasks with Loadiine Super Mario Maker save files and respectively Cemu
This is a module to simplify all kinds of tasks with Loadiine Super Mario Maker save files and respectively Cemu. It uses Javascript's async/await keywords that are available from Node >= 7.6.
With npm:
$ npm install --save cemu-smm
let smm = require("cemu-smm");
// use the legacy submodule if you need transpiled code
//let smm = require("cemu-smm").legacy;
let fs = require("fs");
(async () => {
// let us load our SMM save file
let save = await smm.loadSave("path/to/your/cemu/save/mlc01/emulatorSave/updateID");
// reorder our course folders to match actual ingame appearance
save.reorder();
// recalculate crc checksum and write to 'save.dat'
// this always has to be done when changing bytes, e.g. in a Hex Editor
// internally done by reorder(), so unnecessary right here
save.writeCrc();
// import all jpg files and create tnl files in their respective course folder
save.importJpeg();
// extract all tnl files to jpeg in their respective course folder
save.exportJpeg();
// load course folders inside save folder and write result to file in readable format
let courses = await save.loadCourses();
fs.writeFileSync(`${__dirname}/courses.json`, JSON.stringify(courses, null, 2));
// load course block data and write result to file in readable format
//save.loadCourseElements(); // load whole save folder
courses["course001"].loadElements(); // or load single course
fs.writeFileSync(`${__dirname}/course001.json`, JSON.stringify(courses["course001"].getElements(), null, 2));
// convert tnl to jpeg
let tnl = smm.loadImage("path/to/your/tnl/file");
let jpeg = await tnl.toJpeg();
fs.writeFileSync("path/to/newly/created/jpeg", jpeg);
// convert jpeg to tnl
jpeg = smm.loadImage("path/to/your/jpeg/file");
// default conversion
tnl = await jpeg.fromJpeg();
fs.writeFileSync("path/to/newly/created/tnl", tnl);
// to wide
tnl = await jpeg.fromJpeg(true);
fs.writeFileSync("path/to/newly/created/tnl", tnl);
// to 4:3
tnl = await jpeg.fromJpeg(false);
fs.writeFileSync("path/to/newly/created/tnl", tnl);
})();
Load your save
let save = await smm.loadSave("path/to/your/cemu/save/mlc01/emulatorSave/updateID");
When calling
save.reorder();
becomes
Load an image with
let tnl = smm.loadImage("path/to/your/tnl/file");
Do the conversion with
let jpeg = await tnl.toJpeg();
Save your file
fs.writeFileSync("path/to/newly/created/jpeg", jpeg);
Load an image with
let jpeg = smm.loadImage("path/to/your/jpeg/file");
Do the conversion with
let tnl = await jpeg.fromJpeg([isWide, [doCrop = false]]);
If isWide === true
, thumbnail0 will be created, otherwise thumbnail1.
If isWide === null
, the algorithm tries to guess the correct aspect ratio.
If doCrop === false
, parts of the image may be letter boxed.
If doCrop === false
, parts of the image may be cropped.
Images will automatically be resized to fit Super Mario Maker standards. You can even convert 4k images. If the file is still too big after rescaling, the quality of the JPEG will be shrinked.
Save your file
fs.writeFileSync("path/to/newly/created/jpeg", tnl);
To convert all tnl files inside your save to jpeg, call
save.exportJpeg();
Navigate to your save folder and find jpeg files inside course folders.
To convert all jpeg files inside your save to tnl, call
save.importJpeg();
Files inside course folders must be named thumbnail0.jpg
or ```thumbnail1.jpg````.
Refer to this tutorial.
MIT License Copyright (c) 2017 Mario Reder
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
This is a module to simplify all kinds of tasks with Loadiine Super Mario Maker save files and respectively Cemu
The npm package cemu-smm receives a total of 13 weekly downloads. As such, cemu-smm popularity was classified as not popular.
We found that cemu-smm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.