Skip to content

A new development environment for the 3DO Opera game console

Notifications You must be signed in to change notification settings

trapexit/3do-devkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a 3DO Opera development environment for Linux and Window. It is built from a number of components both new and old. The hope is that by making setup more turnkey and bringing documentation and examples into one location it will help facilitate more homebrew on the 3DO.

Components

Compilers

  • Norcroft ARM C v4.91 (ARM Ltd SDT2.51) [Build number 130] for Linux
  • Norcroft ARM C v4.91 (ARM Ltd SDT2.51) [Build number 128] for Windows
  • Norcroft ARM C++ v0.61/v4.91 (ARM Ltd C++1.11) [Build number 130] for Linux
  • Norcroft ARM C++ v0.61/v4.91 (ARM Ltd C++1.11) [Build number 128] for Windows

Libraries

  • Original 3DO libraries from Portfolio 2.5 SDK
  • cpplib: basic replacement C++ standard library
  • svc_funcs: provides access to kernel functions while in supervisor mode
  • svc_mem: example device driver and its library
  • example_folio: example Folio (shared library)
  • ttl: trapexit's template library (simplistic replacement to STL)
  • Roguewave STL which originally came with ARM C++ (probably not worth using)

Documentation

It is strongly suggested that new developers start with the original 3DO SDK documentation. While the layout is imperfect the documentation is reasonably thorough. The 3DO uses a high level operating system that abstracts the hardware and provides many features such as semaphores, threading, message passing, signals, etc. An initial focus on the OS APIs and how graphics work on the console is suggested.

More can be found at https://3dodev.com

Tooling

  • 3it: trapexit's 3DO Image Tool
  • 3at: trapexit's 3DO Audio Tool
  • 3dt: trapexit's 3DO Disc Tool
  • 3ct: trapexit's 3DO Compression Tool
  • modbin: trapexit's recreation of the original SDK's tool by the same name
  • 3doiso v0.1 by nikk
  • 3DOEncrypt v0.6a by Charles Doty
  • MakeBanner v1.0b by Charles Doty
  • BMPTo3DOCel v0.6a by Charles Doty
  • BMPTo3DOImage v1.0b by Charles Doty
  • BMPTo3DOAnim v0.6a by Charles Doty
  • GNU make for Windows

trapexit's tooling may not always be fully up to date in this repo so double check by visiting the links provided above.

Examples

Misc

  • 3DO "takeme" CDROM base files from Portfolio 2.5 w/ a swapped out boot_code from Game Guru.

Install

There really isn't a need to "install". You can download the repo and start using it in place. See #Usage below. However, you can set things up in a manner similar to a global install.

Windows

  • Download the dev kit.
  • Uncompress and move the folder into its final location.
  • Run bin\buildtools\win\setup-3do-devkit-env.bat
  • This will setup the appropriate environment variables at a global level. This removes the need to use activate-env.bat or activate-env.ps1 each terminal session.

Note: the devkit includes make.bat and make-run.bat which need no activation and can be run from Explorer.

Linux

  • Download: git clone --depth=1 https://github.com/trapexit/3do-devkit
  • Add source /path/to/3do-devkit/activate-env to your shell config file.

Usage

This setup is intended to be as simple as possible to start using. To that end it is primarily designed to be used in-place. There is no install required. Just download, activate environment, and build.

General

  • Modify Makefile to change the project NAME. Not much else should need to be modified in the Makefile for basic usage.
  • The makefile handles assembly source files (*.s), C files (*.c), and C++ files (*.cpp) in the root of src/.
  • Add and/or remove files from src/ as needed for your project.
  • Run make to build object files, link executable, build ISO, and sign ISO for retail system usage.

See below for OS specific workflows.

Windows

General

  • Download
  • Uncompress and move the folder into its final location
  • From a terminal (cmd.exe or PowerShell):
    • Enter the directory: cd 3do-devkit
    • Source the environment: activate-env (CMD) or .\activate-env (PowerShell)
    • Run make: make
      • Generates iso\helloworld.iso
    • Run in RetroArch Opera emulator (if installed): make run
  • From Explorer:
    • Enter the directory
    • Run make.bat to build the project
    • Run make-run.bat to run the created iso via Opera if RetroArch is installed
    • Run make-clean.bat to remove build files

WSL2

Same as Linux

Linux

The ARM compile suite binaries are x86 32bit. Be sure to install 32bit support for your distro. On Debian / Ubuntu based distros that would be:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386

Also ensure you have WINE installed. Some tools are currently only available on Windows.

makefile

  • Download: git clone --depth=1 https://github.com/trapexit/3do-devkit
  • Enter the directory: cd 3do-devkit
  • Source the environment: source activate-env
  • Run make: make
    • Generates iso/helloworld.iso
    • Run in RetroArch Opera emulator (if installed): make run
  • Run make clean to clean up build files

Bootstrapping a New Project

If you have "installed" the dev kit as described above or activated the environment you can easily copy code, assets, and build tools into their own directories which will use the binaries found in the "install" location.

To simplify the creation of these there is the bootstrap-3do-project script.

Windows

  • Run setup-3do-devkit-env.bat (if not done already) to setup paths globally or activate-env
  • Make a directory for your project
  • Change the directory to your new project path
  • Run bootstrap-3do-project.bat
  • Or copy bootstrap-3do-project.bat to that directory and run it (from shell or Explorer)

This will copy all relevant files into the path and can be used the same as described above. Feel free to remove bootstrap-3do-project.bat afterwards.

Linux

  • Source activate-env as described above
  • Make a directory for your project
  • Run bootstrap-3do-project from within that directory
  • You can also run bootstrap-3do-project PATH

RetroArch Opera Setup

make run will launch the Opera core of RetroArch if installed and run the built ISO. RetroArch can be found at https://retroarch.com but you will need ROMs for Opera to work correctly.

The script download-retroarch-opera-roms will attempt to download required ROMs to the "system" directory of RetroArch if already installed. On Windows or Linux launch from a file explorer or a terminal.

NOTE: The scripts look in known directories to copy the ROMs to but it is possible you have a different setup. You can just go to the site and download the ROMs manually and place them into the RetroArch system folder.

DevKit Layout

  • bin/: All core binaries such as compilers, linkers, media conversion tools, and misc tooling.
  • src/: Directory storing all application source.
  • takeme/: Directory storing all CDROM artifacts. Target for final "Launchme" executable. The name "takeme" originates from the original 3DO SDK.
  • art/: 3DO artwork. Currently only original 3DO SDK art.
  • docs/: Misc documentation from the original SDK and compiler suites.
  • include/: All include files from original SDK and community projects.
  • lib/: All libraries from original SDK and community projects.
  • examples/: Examples from all available original 3DO SDK releases as well as new and reworked examples.
  • build/: Automatically created directory during build to store object files.
  • iso/: Automatically created directory during build to store ISO file.

Media Conversion

images

3it is a comprehensive tool supporting conversion to and from CELs, IMAGs, Banners, etc. Older tools are included for completeness but should not be needed.

Read more about CEL formats at:

audio

The 3DO can handle multiple sample rates, sample sizes, channels, and codecs.

SDX2 compresses the audio to 8bits per sample and according to the original author, Phil Burk, sounds noticeably better than using raw 8bit samples. Intel/DVI ADP4 compresses down to 4 bits per sample but only allows for mono audio and is notably worse sounding compared to SDX2. SDX2 will typically be best for music and ADP4 for sound effects.

ffmpeg can be used to convert files to a couple raw audio formats which 3DO can use however ffmpeg does not currently have a SDX2 encoder (only decoder) or a Intel/DVI ADP4 encoder or decoder (though adpcm_ima_ws is similar.)

trapexit's 3at can be used to convert to and from SDX2 and Intel/DVI ADP4.

video

A Cinepak library was included in the original SDK. Unfortunately, ffmpeg does not support the 3DO Stream container format nor does the Cinepak encoder generate frames which align properly for the 3DO.

Till a new decoder is written or ffmpeg modified to provide proper alignment you will need to use original Classic MacOS software.

TODO

  • Project files for popular IDEs.
  • Rework libc. Add missing functions.
  • Rebuild original privileged libraries and enhance them where possible.
  • Continue to enhance the C++ standard library replacement.
  • C++ based 3DO specific libraries.
  • Create a new iso building tool.
  • Create a new iso encrypt tool.
  • More examples.
  • Better compiler support. Possibly use CLANG or GCC to generate assembly and translate it to work with Norcroft armasm.
  • More languages? If you have a ARMv3 compatible compiler and AIF linker (even if just different versions of Norcroft compilers) please reach out.
  • A version of the Opera emulator tailored for development work?

FAQ

Why not use a more modern compiler suite?

The 3DO is an early ARMv3 based system which used ARM's Norcroft compiler, relocatable AIF executable format, AOF object format, etc. Support for these formats were abandoned by ARM around the time the console was retired and the limited open source compiler suite support for these formats were removed long long ago. Support for ARMv3 era CPUs have also been removed.

trapexit has spoken with John Fitch of Codemist regarding licensing or open sourcing their ARM compiler suite as well as individuals who maintain the compiler suite for RISCOS. Unfortunately, neither were able to help. The latter having narrowly scoped licensing with no ability to sublicense.

Adding ARMv3 support to a modern compiler might not be so hard given ARMv4 is still supported by but adding AIF and AOF to modern linkers would likely be a decent amount of work and maintenance. There are other ideas ranging from an ELF to relocatable AIF converter to transpiling ARMv4 assembly to armasm compatible assembly.

Thanks

  • @ArmSoftwareDev on Twitter and Arm Support: for providing me with copies of ARM SDT 2.51 and ARM C++ 1.11. After reaching out to former Norcroft employees, software archivists, and even Bjarne Stroustrup without success finding a copy of ARM C++ from the 3DO era I reached out to ARM directly and they were able to find some copies and offered them to me for this project.
  • Everyone at The 3DO Community Discord.
  • XProger: author of 3DO OpenLara and Wipeout prototype ports.
  • Shaun 3DOHD: author of REAL 3DO Tetris and MK2 3DO Edition.
  • zyzix: author of Biofury, JinglesDefense, REAL Tempest, and the Matinicus engine.

Links

Donations / Sponsorship

If you find 3do-devkit and the surrounding tooling useful please consider supporting its ongoing development.

https://github.com/trapexit/support

About

A new development environment for the 3DO Opera game console

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published