Code Monkey home page Code Monkey logo

3it's Introduction

3it: 3DO Image Tool

An all purpose 3DO image conversion tool. Can convert to and from JPEG, PNG, BMP, 3DO CEL, 3DO Banner, 3DO ANIM, 3DO IMAG, NFS 3SH, and NFS wwww formats. Supports coded and uncoded, packed and unpacked, linear and lrform CELs.

Usage

$ 3it --help
3it: 3DO Image Tool
Usage: 3it [OPTIONS] SUBCOMMAND

Options:
  -h,--help                   Print this help message and exit
    --help-all

Subcommands:
  version                     print 3it version and license
  docs                        print links to relevant documentation
  info                        prints info about the file
  list-chunks                 list 3DO file chunks
  to-cel                      convert image to 3DO CEL
  to-banner                   convert image to banner
  to-imag                     convert image to 3DO IMAG
  to-lrform                   convert image to raw LRFORM
  to-bmp                      convert image to BMP
  to-png                      convert image to PNG
  to-jpg                      convert image to JPG
  to-nfs-shpm                 convert image to Need for Speed SHPM

$ 3it to-cel --help
...

All subcommands have their own help and arguments. Use --help or --help-all to see all available options.

File Types

LRFORM

It is common to use IMAG files as a background that is used to clear the screen between screen updates by leveraging SPORT VRAM -> VRAM copying. However, due to alignment requirements and needing to read data off of a CDROM the LoadImage() function utilizes more resources than needed. Especially given LoadImage were never expanded to support anything but 320x240 @ 16bpp LRFORM images.

Having a raw LRFORM file allows the user to load it using LoadFile and saves on resources. See LoadImage's code for more details.

int memflags;
int filesize;
char *image;
char *filename = "image.lrform";

memflags = (MEMTYPE_TRACKSIZE|MEMTYPE_STARTPAGE|MEMTYPE_VRAM);
image    = LoadFile(filename,&filesize,memflags);

Output Filename Templates

Any command with an --output-path option supports templating to make scripting easier. It uses a currly brace notation such as {foo}. Below is a list of supported values per subcommand.

All support:

  • {filepath}: Full original input filepath.
  • {dirpath}: Parent path of {filepath} if it has one. "." otherwise.
  • {filename}: Just the filename without dirpath or extension.
  • {origext}: The original filepath's extension. Includes prefixed '.'.
  • {ext}: The standard extension for the target file.
  • {name}: If supported by the input the internal name for the image. Prefixed with "". Otherwise "".
  • {index}: The index of the image if the input had multiple images.
  • {index}: The index prefixed with "" if input had multiple images. Otherwise "".
  • {w}: Width of the output image.
  • {h}: Height of the output image.

to-cel

  • {coded}: "coded" if coded else "uncoded".
  • {packed}: "packed" if packed else "unpacked".
  • {lrform}: "lrform" if lrform else "linear".
  • {_lrform}: "_lrform" if lrform otherwise "".
  • {bpp}: The CEL bits per pixel.
  • {flags}: CCB flags in hex.
  • {pixc}: CCB PIXC/PPMPC in hex.
  • {rotation}: "0", "90", "180", or "270"

to-banner

  • {bpp}: Always 16.

Others

No extras.

TODO

  • dump APPSCRN from ISO
  • dump-chunks
  • concat-chunks
  • to ANIM
  • ability to write text chunks
  • figure out NFS HSPT chunk
  • ability to write NFS wwww files? May deserve its own tool.
  • Other game formats

Documentation

Other Links

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.