Code Monkey home page Code Monkey logo

Comments (2)

p4plus2 avatar p4plus2 commented on July 16, 2024

This is an interesting issue since technically this is by design. When Asar allocates the ROM it allocates the full 16MB region and all unused regions are 00s. This happens before even a single line of ASM is parsed, so there isn't a way to control this from the ASM level.

There are two possible solutions here:

  1. CLI flag for the uninitialized byte
  2. When ROM expansion is handled use the pad byte to reset the memory between the current romlen and future romlen.

Option 1 will in general lead to consistent results, where option 2 allows for different expansion regions to have different padding bytes. Option 2 could lead to unexpected situations where freespace is "lost" due to unexpected padding and other tools having more rigid definitions of what free space is. Option 2 also has a side effect that org based writes will not update anything in between to the pad byte.

memset(const_cast<unsigned char*>(romdata)+romlen, 0x00, (size_t)(16*1024*1024-romlen));

Thats the source of the issue, this is called in openrom.

There isn't really a great work around for this in the meantime.

from asar.

Piranhaplant avatar Piranhaplant commented on July 16, 2024

A command line option would work well for my use case. It could even use the same value as the default for when the freespace byte isn't specified in the command.

from asar.

Related Issues (20)

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.