Skip to content

Releases: kilograham/rp2040-doom

DEFCON32 Badge Doom - V1 (better audio, input and multiplayer)

18 Aug 19:27
Compare
Choose a tag to compare

Getting Started with Doom on your badge

See The README for the latest info and more instructions including multiplayer wiring

NOTE: installing Doom will overwrite the contents of flash on your Badge. You should either back up the contents first, or just be prepared to download and re-flash the stock firmware later. Use this firmware at your own risk!!

Note you can install Doom on your badge by:

  1. Turning the badge off
  2. Unplugging it
  3. Holding the BOOT button on the back while plugging the USB back in. This should bring up an RP2350 drive on your computer (/possibly phone)
  4. Drag doom1_v1.uf2 onto the RP2350 drive and wait for it to download and reboot

See the bottom of these notes for details on using picotool to save your original flash contents and more

Overview

This is a version of my "rp2040-doom" (which itself now supports RP2350) modified to run on the DEFCON 32 Badge

Note that the badge speaker seems to distort really easily, so I have the sound turned way down for now, this is probably good
anyway so you don't annoy people around you, but the volume control in the menus does work.

If you want to read about getting the fully functional and complete Demo version of Doom running in 264K and 2MB of flash, you can do so
in the blog post here.

The regular build instructions should work with the latest pico-sdk and other dependencies, but you should pass
-DPICO_BOARD=defcon32_badge to CMake as well.

Things that I have tried and are kwown to work:

  • Demos
  • Playing a game
  • Completing levels
  • Save/Load game (note these are stored in flash, so will persist across badge power cycles)
  • Muliplayer via I2C (at least with 2 players, should work with up to 4) - see README for wiring

Things that don't work:

  • "Quit Game" main menu item which is actually meant to quit to DOS (i removed the DOS mode because it uses 640x480 screen)
    • Note the menu to end an active game is actually under "Options/End Game", and does work
  • There is no way to enter cheats

Things that might work:

  • The end sequence (easier to test when I have added cheats)

Controller Input:

Normal button behavior

Button Behavior
Start Show Menu / Go back
Select Select Menu
Left / Right / Up / Down Move
A Open Door
B Fire

Button behavior when pressing the FN (bottom right on the back) during game

Button Behavior
FN+Start Show / Hide Map
FN+Select Press Select in rapid succession with FN down to press 1 then 2 then 3 etc. to select weapons
FN+Left / Right / Up / Down / A / B Strafe

Note when FN is pressed, An FPS indicator is also shown

Button behavior in menus

Button Behavior
A Menu Back or 'N' (No)
B Menu Fowrard/Select or 'Y' (Yes)

Button behavior when typing

Button Behavior
Up/Down Cycle through letters/space
Left Backspace
Right Select letter

Using picotool

Picotool is a very handy complement to RP2040 and RP2350 devices for interacting with devices in BOOTSEL mode (i.e. after holding BOOT while powering on)

You can find the source and build instructions here

You can backup your whole badge flash by doing

picotool save -a all_flash.bin
picotool verify all_flash.bin

you can then load it back later via:

picotool load all_flash.bin

Or

picotool load --family absolute all_flash.bin

If picotool complains based on what is in your flash already

Files

doom1_v1.uf2 - this is a UF2 which includes both the code and the WAD in one

You can load it with picotool or by drag/drop

picotool load -vx doom1_v1.uf2

Note you can use picotool info to see what is on your device

$ picotool info 
Program Information
 name:          doom_tiny
 features:      WHX at 0x10040000
                I2C multi-player
                UART stdin / stdout
 binary start:  0x10000000
 binary end:    0x1003d92c
 target chip:   RP2350
 image type:    ARM Secure

DEFCON32 Badge Doom

11 Aug 12:48
Compare
Choose a tag to compare

Getting Started with Doom on your badge

NOTE: installing Doom will overwrite the contents of flash on your Badge. You should either back up the contents first, or just be prepared to download and re-flash the stock firmware later. Use this firmware at your own risk!!

Note you can install Doom on your badge by:

  1. Turning the badge off
  2. Unplugging it
  3. Holding the BOOT button on the back while plugging the USB back in. This should bring up an RP2350 drive on your computer (/possibly phone)
  4. Drag doom1_full.uf2 onto the RP2350 drive and wait for it to download and reboot

See the bottom of these notes for details on using picotool to save your original flash contents and more

Overview

This is a version of my "rp2040-doom" (which itself now supports RP2350) modified to run on the DEFCON 32 Badge. Thanks to Dmitry for some LCD code that I borrowed!

Note that the badge speaker seems to distort really easily, so I have the sound turned way down for now, this is probably good
anyway so you don't annoy people around you, but the volume control in the menus does work.
The audio is now much better, if still a little quiet.

If you want to read about getting the fully functional and complete Demo version of Doom running in 264K and 2MB of flash, you can do so
in the blog post here.

The regular build instructions should work with the latest pico-sdk and other dependencies, but you should pass
-DPICO_BOARD=defcon32_badge to CMake as well.

Things that I have tried and are kwown to work:

  • Demos
  • Playing a game
  • Completing levels
  • Save/Load game (note these are stored in flash, so will persist across badge power cycles)

Things that don't work:

  • "Quit Game" main menu item which is actually meant to quit to DOS (i removed the DOS mode because it uses 640x480 screen)
    • Note the menu to end an active game is actually under "Options/End Game", and does work
  • There is no button for strafe
  • There is no way to enter cheats

Things that might work:

  • The end sequence
  • Multiplayer; rp2040-doom does support I2C networked games

Controller Input:

Normal button behavior

Button Behavior
Start Show Menu / Go back
Select Select Menu
Left / Right / Up / Down Move
A Open Door
B Fire

Button behavior when pressing the FN (bottom right on the back)

Button Behavior
FN+Select Show / Hide Map
FN+Up Y (for menus)
FN+Down N (for menus)
FN+Left Press Left in rapid succession with FN down to press 1 then 2 then 3 etc. to select weapons

Note when FN is pressed, An FPS indicator is also shown

Button behavior when typing

Button Behavior
Up/Down Cycle through letters/space
Left Backspace
Right Select letter

Note that typing does not seem to work in any dialogs except save game.

Using picotool

Picotool is a very handy complement to RP2040 and RP2350 devices for interacting with devices in BOOTSEL mode (i.e. after holding BOOT while powering on)

You can find the source and build instructions here

You can backup your whole badge flash by doing

picotool save -a all_flash.bin
picotool verify all_flash.bin

you can then load it back later via:

picotool load all_flash.bin

Or

picotool load --family absolute all_flash.bin

If picotool complains based on what is in your flash already

Files

doom1_full.uf2 - this is a UF2 which includes both the code and the WAD in one

You can load it with picotool or by drag/drop

picotool load -vx doom1_full.uf2

Note you can use picotool info to see what is on your device

$ picotool info 
Program Information
 name:          doom_tiny
 features:      WHX at 0x10040000
                I2C multi-player
                UART stdin / stdout
 binary start:  0x10000000
 binary end:    0x1003dc38
 target chip:   RP2350
 image type:    ARM Secure

cosmic unicorn version (just for fun)

19 Mar 23:45
Compare
Choose a tag to compare

Cosmic Unicorn version!

This is just a bit of fun, so not really planning to merge into RP2040 branch. Note the unicorn version (without rewriting all the drawing completely) adds quite a bit of code, so this only builds with Clang

To build with Clang, you need >1.5.0/develop of pico-sdk (and pico_extras), and pass -DPICO_COMPILER=pico_arm_clang, and -DPICO_TOOLCHAIN_PATH=path to ARM embedded LLVM 14.0.0 to CMake.

You must also specify -DPICO_BOARD=pimoroni_cosmic_unicorn to CMake also (or in your env). You want to build doom_tiny_unicorn (the others won't work)

Note that the unicorn uses 16K of RAM for the frame buffer, and so that is new RAM we didn't have space for, so i have decreased the size of the columns area. You may experience OOM on some levels, or visual distortion

Here are the keys:

   Sleep: Enter / Fire (keyboard L-CTRL & Return)
   Vol+: UP/Forward (keyboard Up)
   Vol-: Down/Backward (keyboard Down)
   Brightness+: Back one menu (keyboard Backspace)
   Brightness-: Toggle menu (keyboard Escape)
   A: Right (keyboard Right)
   B: Left (keyboard Left)
   C: Door open (keyboard Space)
   D: Strafe (keyboard Alt)
   
   You can start a game with Enter/Enter/Enter

v0.1

14 Mar 13:21
Compare
Choose a tag to compare

Initial Release

The attached binary will run on a Raspberry Pi Pico and contains the shareware DOOM1.WAD, and is built to match PICO_BOARD=vgaboard which has the following pins:

 0-4:    Red 0-5
 6-10:   Green 0-5
 11-15:  Blue 0-5
 16:     HSync
 17:     VSync
 18:     I2C1 SDA
 19:     I2C1 SCL
 20:     UART1 TX
 21:     UART1 RX
 26:     I2S DIN
 27:     I2S BCK
 28:     I2S LRCK

It includes USB keyboard via TinyUSB host mode, which is known to work with Raspberry Pi keyboards, and may or may not work with others. Keyboard input is also possible over UART using sdl_event_forwarder.