Skip to content

kan8223-dotcom/TanakaDOOM-cGcm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TanakaDOOM-cGcm Edition

A Doom port that runs on real PS3 hardware. Based on Chocolate Doom 3.1.0, using raw cellGcm API โ€” no SDL, no OpenGL, just direct RSX GPU control.

Developed entirely through AI conversation (Claude/Anthropic) by a person with zero programming experience. 24+ chat threads over several months.

๐Ÿ‡ฏ๐Ÿ‡ต ๆ—ฅๆœฌ่ชž็‰ˆREADME

PS3 Doom Screenshot

Running on RPCS3 (PS3 emulator). The engine includes SPU support, but the current version uses PPU-only decoding as SPU does not work on real hardware yet.

Features

  • Raw cellGcm rendering โ€” No SDL. Direct RSX GPU API calls. 320ร—200 8-bit palette โ†’ ARGB32 โ†’ 1280ร—720 scaled output
  • Full BGM โ€” All 13 tracks via minimp3 PPU decoding, 44100Hz โ†’ 48000Hz resampling
  • Sound effects โ€” cellAudio event queue, DMX 8-bit/11025Hz/mono โ†’ float32/48000Hz/stereo, 8-channel simultaneous mixing
  • 35fps stable โ€” Improved from 0.45fps (80x speedup through timer, vsync, and render target fixes)
  • Real hardware tested โ€” CFW PS3 Slim CECH-2000A (Evilnat 4.92.2 CEX)
  • RPCS3 compatible โ€” XInput (Xbox controller) recommended
  • Save/Load โ€” 6 slots, auto map naming, data persists across PS3 reboot

Note: Both projects are based on different Doom source ports and share no code with each other.

How is this different from xttl's PS3 DOOM?

xttl PS3 DOOM TanakaDOOM-cGcm Edition
Base Original Doom source Chocolate Doom 3.1.0
Developer Programmer Zero programming experience + AI
Rendering SDL-based Raw cellGcm
BGM None All 13 tracks (PPU decode)
Save/Load None 6 slots (persistent across reboot)
Development Hand-coded AI conversation (Claude)
Source available Yes (zip) Yes (GitHub)

Download

Download the pkg from Releases. Install directly on a CFW PS3.

Build Instructions

Requirements

  • WSL2 (Ubuntu) or Linux
  • PSL1GHT SDK
  • DOOM1.WAD (Shareware)
  • 13 BGM MP3 files

Get DOOM1.WAD

wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O DOOM1.WAD

Prepare BGM MP3s

  1. Extract MUS data from DOOM1.WAD (using deutex or similar)
  2. Convert MUS โ†’ MIDI
  3. Convert MIDI โ†’ MP3 (Bear Audio Tool, etc.)

Required files (13 tracks):

D_E1M1.mp3  D_E1M2.mp3  D_E1M3.mp3  D_E1M4.mp3  D_E1M5.mp3
D_E1M6.mp3  D_E1M7.mp3  D_E1M8.mp3  D_E1M9.mp3
D_INTER.mp3  D_INTRO.mp3  D_INTROA.mp3  D_VICTOR.mp3

Build

# PSL1GHT environment
export PSL1GHT=/path/to/PSL1GHT
export PS3DEV=/path/to/ps3dev
export PATH=$PS3DEV/bin:$PS3DEV/ppu/bin:$PS3DEV/spu/bin:$PATH

# Clone
git clone https://github.com/kan8223-dotcom/TanakaDOOM-cGcm.git
cd TanakaDOOM-cGcm

# Place DOOM1.WAD and MP3s in repository root
cp /path/to/DOOM1.WAD .
cp /path/to/mp3s/D_*.mp3 .

# Create build directory
mkdir -p build

# Binary embedding (WAD + MP3 + SPU ELF)
ppu-objcopy -I binary -O elf64-powerpc -B powerpc DOOM1.WAD build/DOOM1_WAD.o

for song in D_E1M1 D_E1M2 D_E1M3 D_E1M4 D_E1M5 D_E1M6 D_E1M7 D_E1M8 D_E1M9 D_INTER D_INTRO D_INTROA D_VICTOR; do
  lower=$(echo "$song" | tr 'A-Z_' 'a-z_' | sed 's/^d_//')
  ppu-objcopy -I binary -O elf64-powerpc -B powerpc ${song}.mp3 build/bgm_${lower}.o
done

# SPU ELF (unused in current PPU decode version, but required by Makefile)
spu-gcc -O2 -Wall -nostartfiles -nostdlib -I./source -o bgm_spu.elf source/bgm_spu.c
ppu-objcopy -I binary -O elf64-powerpc -B powerpc bgm_spu.elf build/bgm_spu_elf.o

# Build
make

# Create pkg (for real hardware)
make doom_ps3.pkg

Install on PS3

  1. Copy doom_ps3.pkg to a FAT32 USB drive (root directory)
  2. Insert into PS3 โ†’ XMB โ†’ Package Manager โ†’ Install
  3. "TanakaDOOM-cGcm Edition" appears in Games โ†’ Launch

Test on RPCS3

RPCS3_DIR="/path/to/rpcs3"
mkdir -p "$RPCS3_DIR/dev_hdd0/game/TDCGCM01/USRDIR"
cp doom_ps3.self "$RPCS3_DIR/dev_hdd0/game/TDCGCM01/USRDIR/EBOOT.BIN"

Controller setup (important):

  • Handler: XInput recommended
  • Left Stick / Right Stick: Clear all bindings (prevents cursor runaway)
  • L3 / R3: Clear

PS3-Specific Source Files

The Chocolate Doom core is mostly unmodified. These files were created or modified for PS3:

File Description
i_doom_interface.c Bridge between Doom engine and PS3. PS3 implementations of I_* functions
i_video_ps3.c Raw cellGcm rendering. 320ร—200 8-bit โ†’ ARGB32 โ†’ 1280ร—720 scaling (HSYNC)
i_sound_ps3.c cellAudio event queue. DMX โ†’ float32/48kHz resampling. 8ch mixing + BGM mix
i_music_ps3.c BGM via minimp3 PPU decode + 44100โ†’48000Hz resampling. Ring buffer
i_input_ps3.c Controller input. Garbage value filtering, cooldown, timestamp-based KEYUP
i_system_ps3.c Timer (sysGetCurrentTime), Sleep
p_saveg.c Save/Load direct memory buffer for PS3 (no FILE* dependency)
g_game.c PS3 save via sysFsWrite, load via sysFsRead
bgm_spu.c SPU decoder (reference only โ€” works on RPCS3 but times out on real hardware)
minimp3.h Header-only MP3 decoder (CC0)
ps3_link_stubs.c SDL function stubs
source/SDL/ Fake SDL headers (empty files to suppress include errors)

Architecture

Doom Engine (Chocolate Doom 3.1.0)
  โ”‚
  โ”œโ”€โ”€ Video:  I_VideoBuffer (320ร—200 8bit) โ†’ cellGcm (1280ร—720 ARGB32)
  โ”œโ”€โ”€ Audio:  DMX (8bit/11025Hz) โ†’ cellAudio (float32/48000Hz) + BGM (minimp3 PPU decode)
  โ”œโ”€โ”€ Input:  ioPad โ†’ garbage filter โ†’ Doom event
  โ”œโ”€โ”€ WAD:    ppu-objcopy static link โ†’ direct memory read
  โ””โ”€โ”€ BGM:    MP3 embedded via ppu-objcopy โ†’ minimp3 PPU decode โ†’ ring buffer โ†’ cellAudio mix

FPS Optimization History

Problem FPS Fix
sysGetSystemTime 0.45 Switched to sysGetCurrentTime
gcmSetWaitFlip 7 Removed
set_render_target every frame 18 First frame only
VSYNC Capped at 30 Switched to HSYNC
nsec underflow Stuck at 2 u64 carry handling
After all fixes 35 stable

Known Issues

  • SPU BGM doesn't work on real hardware (root cause unknown, bypassed with PPU decode)
  • Garbage pixels in letterbox area (no gameplay impact)
  • Occasional phantom button presses

BGM Implementation History

  • Thread 9: minimp3 on PPU โ†’ BGM plays but controller input goes haywire (PPU load interferes with DMA)
  • Threads 11-20: Offloaded to 1 SPU โ†’ Works perfectly on RPCS3. Controller issue resolved
  • Threads 21-22: Real hardware test โ†’ SPU never reaches code execution, times out โ†’ Reverted to PPU decode
  • Conclusion: Xbox controller (XInput) eliminates pad issues even under PPU load. SPU issue is RPCS3-vs-real-hardware emulation gap

Development Blog (Japanese)

License

  • Chocolate Doom: GPL v2 (LICENSE)
  • minimp3: CC0 (public domain)
  • DOOM1.WAD: id Software Shareware (freely distributable)
  • PS3-specific code: GPL v2 (Tanaka + Claude/Anthropic)

About

Doom port for PS3 using raw cellGcm API. Built entirely through AI conversation by a non-programmer. BGM + SE + controller support.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages