Skip to content

Commit

Permalink
Initial release!
Browse files Browse the repository at this point in the history
Enjoy guys
  • Loading branch information
Kippykip committed Jan 5, 2020
1 parent 4665edb commit 0b52eb2
Show file tree
Hide file tree
Showing 20 changed files with 94,913 additions and 117 deletions.
Binary file added GbaWadUtil/GbaWadUtil.exe
Binary file not shown.
Binary file added GbaWadUtil/Qt5Core.dll
Binary file not shown.
1 change: 1 addition & 0 deletions GbaWadUtil/build-doom1.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gbawadutil.exe -in doom1.wad -cfile doom1.c
1 change: 1 addition & 0 deletions GbaWadUtil/build-doom2.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gbawadutil.exe -in doom2.wad -cfile doom2.c
1 change: 1 addition & 0 deletions GbaWadUtil/build-ultdoom.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gbawadutil.exe -in doom.wad -cfile doom.c
Binary file added GbaWadUtil/doom1.wad
Binary file not shown.
Binary file added GbaWadUtil/gbadoom.wad
Binary file not shown.
96 changes: 47 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,58 @@
**GBADoom**

A port of prBoom to the GBA. The objective of this project is to get full-fat PC Doom running on the GBA.


**What's working:**

- Supports Doom Shareware, Retail, Utimate and Doom2 IWADS.

- Renderer is largely intact. Z-Depth lighting is gone and there is mip-mapping but it's otherwise complete.

- Monster behaviour etc is all intact. (I.e sound propagation etc)

- Framerate is pretty variable. Simple areas run at ~25fps. Complex areas (Eg: E4M2) chug along at about 5 FPS. It's running around the same as the original GBA Doom1 and Doom2 ports. Doom1 Episodes 1-3 are all completely playable. Episode 4 chugs.

- Sound and music support.


**Still to do:**

- Demo compatability is broken.

- General optimisation. We're never going to get a perfect 35FPS but I think there is still another 25% left without changing the visual quality/correctness/game behaviour. For reference, the first time I ran a build under the emulator it ran at about 3FPS.

- Probably a bunch of other stuff that's borked too...


**Building:**
## GBADoom SVN

A slightly modified version of [doomhack](https://github.com/doomhack/GBADoom)'s amazing port of prBoom to the GBA.
![Episode 2](https://i.imgur.com/kOwpVzW.png)

**What's different?:**
- The HUD is changed to be identical to the GBA Doom II retail HUD, therefore all HUD elements are no longer using scaling algorithms and contain all the HUD elements. This does make the screen vertical viewing space somewhat smaller, not too sure if this improves framerate or not.
- The MUG head turning on damage is restored.
- The chainsaw sounds no longer overlap.
- **B** is now the fire button, and sprinting/use has been changed to **A**. To match the retail GBA Doom II controls.

Be sure to check [doomhack's main branch](https://github.com/doomhack/GBADoom) for future engine optimisations and bug fixes.

## Cheats:
**Chainsaw:** L, UP, UP, LEFT, L, SELECT, SELECT, UP
**God mode:** UP, UP, DOWN, DOWN, LEFT, LEFT, RIGHT, RIGHT
**Ammo & Keys:** L, LEFT, R, RIGHT, SELECT,UP, SELECT, UP
**Ammo:** R, R, SELECT,R, SELECT,UP, UP, LEFT
**No Clipping:** UP, DOWN, LEFT, RIGHT, UP, DOWN, LEFT, RIGHT
**Invincibility:** A, B, L, R, L, R, SELECT, SELECT
**Berserk:** B, B, R, UP, A, A, R, B
**Invisibility:** A, A, SELECT,B, A, SELECT, L, B
**Auto-map:** L, SELECT,R, B, A, R, L, UP
**Lite-Amp Goggles:** DOWN,LEFT, R, LEFT, R, L, L, SELECT
**Exit Level:** LEFT,R, LEFT, L, B, LEFT, RIGHT, A
**Enemy Rockets (Goldeneye):** A, B, L, R, R, L, B, A

## Building:
Video Tutorial: https://www.youtube.com/watch?v=YbZgZqV6JMk

To build the GBA version, you will need DevKitArm. The easiest way to get up and running for Windows users is download the installer from here (https://github.com/devkitPro/installer/releases) and install the GBA dev components.

You will also need GBAWadUtil (https://github.com/doomhack/GbaWadUtil). Windows (x64) users can download the Binary release from the releases page.
You will also need to use GBAWadUtil, included in the "GBAWadUtil\" directory. Alternatively download the latest build from the main source: (https://github.com/doomhack/GbaWadUtil). Windows (x64) users can download the Binary release from the releases page.

1) Use GBAWadUtil to create a header file with the WAD data. Retail, Ultimate and Doom2 wads have been tested. Plutonia and TNT should work.
1) Download or Clone this GBADoom SVN source code.
Extract the contents to a folder: (Eg: C:\DevKitPro\Projects\GBADoom)

Copy your IWAD file to a folder (Eg: C:\Temp\Doom\)
Extract the GBAWadUtil archive to a folder (Eg: C:\Temp\GBAWadUtil\)
2) Use GBAWadUtil to create a header file with the WAD data. Retail, Ultimate and Doom2 wads have been tested. Plutonia and TNT should mostly work.
Open a command prompt.

Type the following:
**GbaWadUtil.exe -in doom.wad -cfile doom.wad.c**
And copy it to the **source\\iwad\\** directory.
Alternatively just run the **build_XXXX.bat** files and it'll create it in the source\iwad\ path.

C:\Temp\GBAWadUtil\GbaWadUtil.exe -in C:\Temp\Doom\Doom.wad -cfile C:\Temp\Doom\Doom.wad.h

2) Download or Clone the GBADoom source code. I recommend downloading from the releases page as the latest code may have issues.

Extract the code to a folder: (Eg: C:\Temp\GBADoom)

3) Copy the C:\Temp\Doom.wad.h (Generated in step 1) to C:\Temp\GBADoom\source\iwad\doom.wad.h
4) Open C:\Temp\GBADoom\source\doom_iwad.h in text editor or code editor of your choice.
5) Change the first line to #include "iwad/doom.wad.h"

5) Open a cmd prompt and type the following:


cd C:\Temp\GBADoom && make
3) Open C:\DevKitPro\Projects\GBADoom\source\doom_iwad.h in text editor or code editor of your choice.
4) Change the first line to #include "iwad/**yourfile**.c" e.g.
#include "iwad/doom1.c"
#include "iwad/doom.c"
#include "iwad/doom2.c"
#include "iwad/tnt.c"
#include "iwad/plutonia.c"

5) Run msys2.bat and type **make**
You may need to edit the msys2.bat with notepad and change the path to go to your real "**msys2\msys2_shell.bat**" file within it if it doesn't work.

7) The project should build GBADoom.gba and GBADoom.elf. It will take about 5 minutes or so. You may see a lot of warning messages on the screen. These are normal.
6) The project should build GBADoom.gba and GBADoom.elf. It will take about 5 minutes or so. You may see a lot of warning messages on the screen. These are normal.

8) Copy GBADoom.gba (this is the rom file) to your flash cart or run in a emulator.
7) Copy GBADoom.gba (this is the rom file) to your flash cart or run in a emulator.
6 changes: 6 additions & 0 deletions include/global_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,12 @@ st_multicon_t w_faces;
// keycard widgets
st_multicon_t w_keyboxes[3];

// ammo widgets
st_number_t w_ammo[4];

// max ammo widgets
st_number_t w_maxammo[4];

// armor widget
st_percent_t st_armor;

Expand Down
44 changes: 22 additions & 22 deletions include/st_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
// proff 08/18/98: Changed for high-res
#define ST_HEIGHT 32
#define ST_WIDTH 320
#define ST_Y (200 - ST_HEIGHT)
#define ST_SCALED_HEIGHT (ST_HEIGHT*SCREENHEIGHT/200)
#define ST_Y (160 - ST_HEIGHT)
#define ST_SCALED_HEIGHT ST_HEIGHT
#define ST_SCALED_WIDTH SCREENWIDTH
#define ST_SCALED_Y (SCREENHEIGHT - ST_SCALED_HEIGHT)

Expand Down Expand Up @@ -98,7 +98,7 @@
#define ST_DEADFACE (ST_GODFACE+1)

// proff 08/18/98: Changed for high-res
#define ST_FACESX (ST_X+143)
#define ST_FACESX (ST_X+104)
#define ST_FACESY (ST_Y)

#define ST_EVILGRINCOUNT (2*TICRATE)
Expand All @@ -121,26 +121,26 @@
// AMMO number pos.
#define ST_AMMOWIDTH 3
// proff 08/18/98: Changed for high-res
#define ST_AMMOX (ST_X+42)
#define ST_AMMOY (ST_SCALED_Y+2)
#define ST_AMMOX (ST_X+32)
#define ST_AMMOY (ST_Y+6)
//#define ST_AMMOX 44
//#define ST_AMMOY 171

// HEALTH number pos.
#define ST_HEALTHWIDTH 3
// proff 08/18/98: Changed for high-res
#define ST_HEALTHX (ST_X+92)
#define ST_HEALTHY (ST_SCALED_Y+2)
#define ST_HEALTHX (ST_X+66)
#define ST_HEALTHY (ST_Y+6)


// Weapon pos.
// proff 08/18/98: Changed for high-res
#define ST_ARMSX (ST_X+268)
#define ST_ARMSX (ST_X+82)
#define ST_ARMSY (ST_Y+4)
#define ST_ARMSBGX (ST_X+104)
#define ST_ARMSBGY (ST_Y)

#define ST_ARMSXSPACE 14
#define ST_ARMSXSPACE 8
#define ST_ARMSYSPACE 10

// Frags pos.
Expand All @@ -154,48 +154,48 @@
// ARMOR number pos.
#define ST_ARMORWIDTH 3
// proff 08/18/98: Changed for high-res
#define ST_ARMORX (ST_X+180)
#define ST_ARMORY (ST_SCALED_Y+2)
#define ST_ARMORX (ST_X+166)
#define ST_ARMORY (ST_Y+6)


// Key icon positions.
#define ST_KEY0WIDTH 8
#define ST_KEY0HEIGHT 5
// proff 08/18/98: Changed for high-res
#define ST_KEY0X (ST_X+309)
#define ST_KEY0X (ST_X+178)
#define ST_KEY0Y (ST_Y+3)

#define ST_KEY1WIDTH ST_KEY0WIDTH
// proff 08/18/98: Changed for high-res
#define ST_KEY1X (ST_X+309)
#define ST_KEY1X (ST_X+178)
#define ST_KEY1Y (ST_Y+13)

#define ST_KEY2WIDTH ST_KEY0WIDTH
// proff 08/18/98: Changed for high-res
#define ST_KEY2X (ST_X+309)
#define ST_KEY2X (ST_X+178)
#define ST_KEY2Y (ST_Y+23)


// Ammunition counter.
#define ST_AMMO0WIDTH 3
#define ST_AMMO0HEIGHT 6
// proff 08/18/98: Changed for high-res
#define ST_AMMO0X (ST_X+288)
#define ST_AMMO0X (ST_X+220)
#define ST_AMMO0Y (ST_Y+5)

#define ST_AMMO1WIDTH ST_AMMO0WIDTH
// proff 08/18/98: Changed for high-res
#define ST_AMMO1X (ST_X+288)
#define ST_AMMO1X (ST_X+220)
#define ST_AMMO1Y (ST_Y+11)

#define ST_AMMO2WIDTH ST_AMMO0WIDTH
// proff 08/18/98: Changed for high-res
#define ST_AMMO2X (ST_X+288)
#define ST_AMMO2X (ST_X+220)
#define ST_AMMO2Y (ST_Y+23)

#define ST_AMMO3WIDTH ST_AMMO0WIDTH
// proff 08/18/98: Changed for high-res
#define ST_AMMO3X (ST_X+288)
#define ST_AMMO3X (ST_X+220)
#define ST_AMMO3Y (ST_Y+17)


Expand All @@ -204,22 +204,22 @@
#define ST_MAXAMMO0WIDTH 3
#define ST_MAXAMMO0HEIGHT 5
// proff 08/18/98: Changed for high-res
#define ST_MAXAMMO0X (ST_X+314)
#define ST_MAXAMMO0X (ST_X+238)
#define ST_MAXAMMO0Y (ST_Y+5)

#define ST_MAXAMMO1WIDTH ST_MAXAMMO0WIDTH
// proff 08/18/98: Changed for high-res
#define ST_MAXAMMO1X (ST_X+314)
#define ST_MAXAMMO1X (ST_X+238)
#define ST_MAXAMMO1Y (ST_Y+11)

#define ST_MAXAMMO2WIDTH ST_MAXAMMO0WIDTH
// proff 08/18/98: Changed for high-res
#define ST_MAXAMMO2X (ST_X+314)
#define ST_MAXAMMO2X (ST_X+238)
#define ST_MAXAMMO2Y (ST_Y+23)

#define ST_MAXAMMO3WIDTH ST_MAXAMMO0WIDTH
// proff 08/18/98: Changed for high-res
#define ST_MAXAMMO3X (ST_X+314)
#define ST_MAXAMMO3X (ST_X+238)
#define ST_MAXAMMO3Y (ST_Y+17)


Expand Down
3 changes: 3 additions & 0 deletions msys2.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set HOME=.
..\..\msys2\msys2_shell.bat
make
Binary file modified music/DSSAWFUL.wav
Binary file not shown.
Binary file modified music/DSSAWHIT.wav
Binary file not shown.
6 changes: 5 additions & 1 deletion source/doom_iwad.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#include "iwad/doomu.gba.h"
#include "iwad/doom1.c"
//#include "iwad/doom.c"
//#include "iwad/doom2.c"
//#include "iwad/tnt.c"
//#include "iwad/plutonia.c"

#include "doom_iwad.h"

Expand Down
7 changes: 4 additions & 3 deletions source/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ const int key_menu_escape = KEYD_START;
const int key_menu_enter = KEYD_A; // phares 3/7/98
const int key_strafeleft = KEYD_L;
const int key_straferight = KEYD_R;
const int key_fire = KEYD_A;
const int key_use = KEYD_B;
const int key_speed = KEYD_B;
//Match Doom II GBA retail controls ~ Kippykip
const int key_fire = KEYD_B;
const int key_use = KEYD_A;
const int key_speed = KEYD_A;
const int key_escape = KEYD_START; // phares 4/13/98
const int key_enter = KEYD_A;
const int key_map_right = KEYD_RIGHT;
Expand Down
12 changes: 9 additions & 3 deletions source/gfx/stbar.h

Large diffs are not rendered by default.

Loading

0 comments on commit 0b52eb2

Please sign in to comment.