Giter VIP home page Giter VIP logo

snsfopt's People

Contributors

loveemu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cartoonfan

snsfopt's Issues

Broken SPC export likely due to incomplete initialization

When exporting a large number of SNSF files to an SPC file, as in snsfopt -x *.minisnsf, it may produce different results than running the command one by one in a separate process. I experienced that during the creation of the SNSF for Shin Megami Tensei II.

Data in snsflib could get slightly erased wrongly sometimes

Summary

This is a bug which is originally found in gsfopt. However, unlike GBA, it should be considered as a very rare case that the glitch actually erases necessary ROM content, because SNES hardware reads ROM data once and transfer it to audio RAM.

Snsfopt is possible to write wrong value to ROM coverage in snsflib optimization (mode -l for instance). Theoretically it might wipe the ROM data quite slightly without being noticed.

How to fix : If you worry about snsflibs that you have optimized by old snsfopt, redo the snsflib optimization with unoptimized ROM, then replace your snsflib to new one.

Occurrence condition

The mechanism of the glitch is simple. It's too stupid.

u8 * rom_coverage;
u8 * another_rom_coverage;

for (u32 offset = 0; offset < size; offset++) {
    if (rom_coverage[offset] + another_rom_coverage[offset] <= 0xff) {
        rom_coverage[offset] += another_rom_coverage[offset];
    } else {
        rom_coverage[offset] += 0xff; // wait, why += is placed here
    }
}

In words: the glitch occurs when the song A refers to a certain address once, and another song B refers to the same address at least 255 times.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.