Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
trapexit committed Aug 4, 2022
0 parents commit 1279d71
Show file tree
Hide file tree
Showing 111 changed files with 43,396 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~
build/
17 changes: 17 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
ISC License

Copyright (c) 2022, Antonio SJ Musumeci <trapexit@spawn.link>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
COMPILER_PREFIX =
PLATFORM = unix
EXE = 3it

OUTPUT = build/$(EXE)

CC = $(COMPILER_PREFIX)-gcc
CXX = $(COMPILER_PREFIX)-g++
STRIP = $(COMPILER_PREFIX)-strip

OPT = -Os -static
#OPT = -O0 -g -fsanitize=address -ggdb -fno-omit-frame-pointer
CFLAGS = $(OPT) -Wall -MMD -MP
CXXFLAGS = $(OPT) -Wall -std=c++17 -MMD -MP

SRC_C = $(wildcard src/*.c)
SRC_CXX = $(wildcard src/*.cpp)

BUILDDIR = build/$(PLATFORM)
OBJ = $(SRC_C:src/%.c=$(BUILDDIR)/%.c.o)
OBJ += $(SRC_CXX:src/%.cpp=$(BUILDDIR)/%.cpp.o)
DEP = $(SRC_CXX:src/%.cpp=$(BUILDDIR)/%.cpp.d)

all: $(OUTPUT)

$(OUTPUT): builddir $(OBJ)
$(CXX) $(CXXFLAGS) -o $(OUTPUT) $(OBJ)

strip: $(OUTPUT)
$(STRIP) --strip-all $(OUTPUT)

builddir:
mkdir -p $(BUILDDIR)

$(BUILDDIR)/%.c.o: src/%.c
$(CC) $(CFLAGS) -c $< -o $@

$(BUILDDIR)/%.cpp.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
rm -rfv build/

.PHONY: clean builddir

-include $(DEP)
43 changes: 43 additions & 0 deletions Makefile.win32
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
COMPILER_PREFIX = i686-w64-mingw32
PLATFORM = win32
EXE = 3it_win32.exe

OUTPUT = build/$(EXE)

CC = $(COMPILER_PREFIX)-gcc
CXX = $(COMPILER_PREFIX)-g++
STRIP = $(COMPILER_PREFIX)-strip

OPT = -Os -static
CFLAGS = $(OPT) -MMD -MP
CXXFLAGS = $(OPT) -std=c++17 -MMD -MP

SRC_C = $(wildcard src/*.c)
SRC_CXX = $(wildcard src/*.cpp)

OBJ += $(SRC_C:src/%.c=build/$(PLATFORM)/%.c.o)
OBJ += $(SRC_CXX:src/%.cpp=build/$(PLATFORM)/%.cpp.o)

DEPS = $(OBJS:.o=.d)

all: $(OUTPUT)

$(OUTPUT): builddir $(OBJ)
$(CXX) $(CXXFLAGS) -o $(OUTPUT) $(OBJ)

strip: $(OUTPUT)
$(STRIP) --strip-all $(OUTPUT)

builddir:
mkdir -p build/$(PLATFORM)/

build/$(PLATFORM)/%.c.o: src/%.c
$(CC) $(CFLAGS) -c $< -o $@

build/$(PLATFORM)/%.cpp.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
rm -rfv build/

-include $(DEPS)
43 changes: 43 additions & 0 deletions Makefile.win64
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
COMPILER_PREFIX = x86_64-w64-mingw32
PLATFORM = win64
EXE = 3it_win64.exe

OUTPUT = build/$(EXE)

CC = $(COMPILER_PREFIX)-gcc
CXX = $(COMPILER_PREFIX)-g++
STRIP = $(COMPILER_PREFIX)-strip

OPT = -Os -static
CFLAGS = $(OPT) -MMD -MP
CXXFLAGS = $(OPT) -std=c++17 -MMD -MP

SRC_C = $(wildcard src/*.c)
SRC_CXX = $(wildcard src/*.cpp)

OBJ += $(SRC_C:src/%.c=build/$(PLATFORM)/%.c.o)
OBJ += $(SRC_CXX:src/%.cpp=build/$(PLATFORM)/%.cpp.o)

DEPS = $(OBJS:.o=.d)

all: $(OUTPUT)

$(OUTPUT): builddir $(OBJ)
$(CXX) $(CXXFLAGS) -o $(OUTPUT) $(OBJ)

strip: $(OUTPUT)
$(STRIP) --strip-all $(OUTPUT)

builddir:
mkdir -p build/$(PLATFORM)/

build/$(PLATFORM)/%.c.o: src/%.c
$(CC) $(CFLAGS) -c $< -o $@

build/$(PLATFORM)/%.cpp.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
rm -rfv build/

-include $(DEPS)
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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, and 3DO IMAG 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
docs print links to relevant documentation
info prints info about the file
list-chunks list 3DO file chunks
to-cel convert image to CEL
to-banner convert image to banner
to-bmp convert image to BMP
to-png convert image to PNG
to-jpg convert image to JPG
```


## TODO

* dump APPSCRN from ISO
* dump-chunks
* concat-chunks
* to IMAG
* to ANIM
* ability to write text chunks


## Notes

I wrote this over the course of a few months on and off. I was playing with some
different ideas so the code is not entirely consistent. Will clean up as needed.


## Documentation

* https://3dodev.com/ext/3DO/Portfolio_2.5/OnLineDoc/DevDocs/ppgfldr/ggsfldr/gpgfldr/5gpg.html


## External sites

* https://3dodev.com
* https://github.com/trapexit/3dt
* https://github.com/trapexit/3do-devkit
Binary file added examples/3DO_Studio.anim
Binary file not shown.
Binary file added examples/3DO_Studio_Logo.img
Binary file not shown.
Binary file added examples/BogusTitle.imag
Binary file not shown.
Binary file added examples/HypotheticalTitle.imag
Binary file not shown.
Binary file added examples/coded_packed_16bpp.cel
Binary file not shown.
Binary file added examples/coded_packed_1bpp.cel
Binary file not shown.
Binary file added examples/coded_packed_4bpp.cel
Binary file not shown.
Binary file added examples/coded_packed_6bpp.cel
Binary file not shown.
Binary file added examples/coded_packed_8bpp.cel
Binary file not shown.
Binary file added examples/coded_unpacked_16bpp.cel
Binary file not shown.
Binary file added examples/coded_unpacked_1bpp.cel
Binary file not shown.
Binary file added examples/coded_unpacked_2bpp.cel
Binary file not shown.
Binary file added examples/coded_unpacked_4bpp.cel
Binary file not shown.
Binary file added examples/coded_unpacked_6bpp.cel
Binary file not shown.
Binary file added examples/coded_unpacked_8bpp.cel
Binary file not shown.
Binary file added examples/uncoded_packed_16bpp.cel
Binary file not shown.
Binary file added examples/uncoded_packed_8bpp.cel
Binary file not shown.
Binary file added examples/uncoded_unpacked_16bpp.cel
Binary file not shown.
Binary file added examples/uncoded_unpacked_8bpp.cel
Binary file not shown.
Loading

0 comments on commit 1279d71

Please sign in to comment.