Git Product home page Git Product logo

resource_dasm's People

Contributors

fuzziqersoftware avatar kristine1975 avatar ownezx avatar sembiance avatar syto203 avatar

resource_dasm's Issues

PICT: simplify skipping of reserved opcodes

There are various if (opcode <= 0x...) checks to skip unknown/reserved opcodes:

} else if (opcode <= 0x01FF) { // args: 2
this->pict_skip_2(r, opcode);
} else if (opcode <= 0x02FE) { // args: 4
r.go(r.where() + 4);
} else if (opcode == 0x02FF) { // args: 2
// nop (essentially) because we look ahead in the 0011 implementation
} else if (opcode <= 0x0BFF) { // args: 22
r.go(r.where() + 22);
} else if (opcode == 0x0C00) { // args: header
// Currently we don't do anything with the data in this subheader, so just
// check that its version makes sense and then ignore it
PictSubheader h = r.get<PictSubheader>();
if ((h.v2.version != -1) && (h.v2e.version != -2)) {
throw runtime_error(string_printf("subheader has incorrect version (%08X or %04hX)",
h.v2.version.load(), h.v2e.version.load()));
}
} else if (opcode <= 0x7EFF) { // args: 24
r.go(r.where() + 24);
} else if (opcode <= 0x7FFF) { // args: 254
r.go(r.where() + 254);

According to IM Imaging with Quickdraw - Appendix A this code could be simplified:

Note: For opcodes $0100-$7FFF, the amount of data for opcode $nnXX = 2 times nn bytes.

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.