Skip to content

Commit

Permalink
rename the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Feb 18, 2021
1 parent 75c4bcc commit 06f5e7a
Show file tree
Hide file tree
Showing 62 changed files with 266 additions and 265 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Build project
run: |
make build
7z a release.zip ./bin/tombati.exe ./build/TR1Main.dll TR1Main.json
7z a release.zip ./bin/tombati.exe ./build/Tomb1Main.dll Tomb1Main.json
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -40,5 +40,5 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release.zip
asset_name: TR1Main-${{ steps.get_version.outputs.VERSION }}.zip
asset_name: Tomb1Main-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CC=i686-w64-mingw32-gcc
CFLAGS=-W -static -shared -Isrc

build: $(shell find src)
$(CC) $(CFLAGS) $(shell find src -type f -iname '*.c') -ldbghelp -o build/TR1Main.dll
$(CC) $(CFLAGS) $(shell find src -type f -iname '*.c') -ldbghelp -o build/Tomb1Main.dll

docker_build:
docker build -t tr1main .
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TR1Main
# Tomb1Main

This is a dynamic library for the classic Tomb Raider I game (TombATI version).
The purpose of the library is to reimplement all the routines performed by the
Expand All @@ -10,13 +10,13 @@ This project is inspired by Arsunt's
## Installing

Get a copy of the latest release from
[here](https://github.com/rr-/TR1Main/releases) and unpack the contents to your
game directory. Make sure you overwrite existing files. Currently TR1Main
[here](https://github.com/rr-/Tomb1Main/releases) and unpack the contents to your
game directory. Make sure you overwrite existing files. Currently Tomb1Main
requires you to have the TombATI patch installed to work.

## Configuring

To configure TR1Main, edit the `TR1Main.json` file in your text editor such as
To configure Tomb1Main, edit the `Tomb1Main.json` file in your text editor such as
Notepad.

Currently the following configuration options are supported:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions bin/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## TR1Main binaries
## Tomb1Main binaries

- `tombati.exe` - a patched version of TombATI executable that loads the `TR1Main.dll` library.
- `tombati.exe` - a patched version of TombATI executable that loads the `Tomb1Main.dll` library.
- `tombati.orig.exe` - the original TombATI version.
Binary file modified bin/tombati.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/progress.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Flags:
# - to do
# * to do, called by TR1Main
# * to do, called by Tomb1Main
# + fully decompiled
#
# Name Offset Size Flags
Expand Down
4 changes: 2 additions & 2 deletions src/3dsystem/3d_gen.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_3DSYSTEM_3D_GEN_H
#define TR1MAIN_3DSYSTEM_3D_GEN_H
#ifndef TOMB1MAIN_3DSYSTEM_3D_GEN_H
#define TOMB1MAIN_3DSYSTEM_3D_GEN_H

// clang-format off
#define S_InsertRoom ((void __cdecl(*)(int16_t* objptr))0x00401BD0)
Expand Down
4 changes: 2 additions & 2 deletions src/3dsystem/3d_insert.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_3DSYSTEM_3D_INSERT_H
#define TR1MAIN_3DSYSTEM_3D_INSERT_H
#ifndef TOMB1MAIN_3DSYSTEM_3D_INSERT_H
#define TOMB1MAIN_3DSYSTEM_3D_INSERT_H

// clang-format off
#define Insert2DLine ((void __cdecl(*)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t z, uint8_t color))0x00402710)
Expand Down
4 changes: 2 additions & 2 deletions src/3dsystem/phd_math.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_3DSYSTEM_PHD_MATH_H
#define TR1MAIN_3DSYSTEM_PHD_MATH_H
#ifndef TOMB1MAIN_3DSYSTEM_PHD_MATH_H
#define TOMB1MAIN_3DSYSTEM_PHD_MATH_H

// clang-format off
#define phd_atan ((int32_t __cdecl(*)(int32_t x, int32_t y))0x0042A8A0)
Expand Down
4 changes: 2 additions & 2 deletions src/3dsystem/scalespr.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_3DSYSTEM_SCALESPR_H
#define TR1MAIN_3DSYSTEM_SCALESPR_H
#ifndef TOMB1MAIN_3DSYSTEM_SCALESPR_H
#define TOMB1MAIN_3DSYSTEM_SCALESPR_H

// clang-format off
#define S_DrawUISprite ((void __cdecl(*)(int32_t x, int32_t y, int32_t scale, int16_t sprnum, int16_t brightness))0x00435D80)
Expand Down
4 changes: 2 additions & 2 deletions src/game/box.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_BOX_H
#define TR1MAIN_GAME_BOX_H
#ifndef TOMB1MAIN_GAME_BOX_H
#define TOMB1MAIN_GAME_BOX_H

#include "game/types.h"

Expand Down
4 changes: 2 additions & 2 deletions src/game/camera.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_CAMERA_H
#define TR1MAIN_GAME_CAMERA_H
#ifndef TOMB1MAIN_GAME_CAMERA_H
#define TOMB1MAIN_GAME_CAMERA_H

// clang-format off
#define CalculateCamera ((void __cdecl(*)())0x00410B40)
Expand Down
4 changes: 2 additions & 2 deletions src/game/collide.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_COLLIDE_H
#define TR1MAIN_GAME_COLLIDE_H
#ifndef TOMB1MAIN_GAME_COLLIDE_H
#define TOMB1MAIN_GAME_COLLIDE_H

#include "types.h"

Expand Down
4 changes: 2 additions & 2 deletions src/game/const.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_CONST_H
#define TR1MAIN_GAME_CONST_H
#ifndef TOMB1MAIN_GAME_CONST_H
#define TOMB1MAIN_GAME_CONST_H

#define ONE_DEGREE 182
#define NUM_PU 3
Expand Down
10 changes: 5 additions & 5 deletions src/game/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,21 @@ int32_t __cdecl ControlPhase(int32_t nframes, int demo_mode)
++SaveGame[0].timer;
--HealthBarTimer;

if (TR1MConfig.disable_healing_between_levels) {
if (Tomb1MConfig.disable_healing_between_levels) {
int lara_found = 0;
for (int i = 0; i < LevelItemCount; i++) {
if (Items[i].object_number == O_LARA) {
lara_found = 1;
}
}
if (lara_found) {
TR1MData.stored_lara_health =
Tomb1MData.stored_lara_health =
LaraItem ? LaraItem->hit_points : LARA_HITPOINTS;
}
}

if (TR1MConfig.healthbar_showing_mode == TR1M_BSM_ALWAYS
|| (TR1MConfig.healthbar_showing_mode == TR1M_BSM_FLASHING
if (Tomb1MConfig.healthbar_showing_mode == Tomb1M_BSM_ALWAYS
|| (Tomb1MConfig.healthbar_showing_mode == Tomb1M_BSM_FLASHING
&& LaraItem
&& LaraItem->hit_points < (LARA_HITPOINTS * 20) / 100)) {
HealthBarTimer = 1;
Expand All @@ -148,7 +148,7 @@ int32_t __cdecl ControlPhase(int32_t nframes, int demo_mode)
return 0;
}

void TR1MInjectGameControl()
void Tomb1MInjectGameControl()
{
INJECT(0x004133B0, ControlPhase);
}
6 changes: 3 additions & 3 deletions src/game/control.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_CONTROL_H
#define TR1MAIN_GAME_CONTROL_H
#ifndef TOMB1MAIN_GAME_CONTROL_H
#define TOMB1MAIN_GAME_CONTROL_H

#include <stdint.h>

Expand All @@ -14,6 +14,6 @@

int32_t __cdecl ControlPhase(int32_t nframes, int demo_mode);

void TR1MInjectGameControl();
void Tomb1MInjectGameControl();

#endif
4 changes: 2 additions & 2 deletions src/game/data.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_DATA_H
#define TR1MAIN_GAME_DATA_H
#ifndef TOMB1MAIN_GAME_DATA_H
#define TOMB1MAIN_GAME_DATA_H

#include "game/const.h"
#include "game/types.h"
Expand Down
4 changes: 2 additions & 2 deletions src/game/demo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_DEMO_H
#define TR1MAIN_GAME_DEMO_H
#ifndef TOMB1MAIN_GAME_DEMO_H
#define TOMB1MAIN_GAME_DEMO_H

// clang-format off
#define GetDemoInput ((void __cdecl(*)())0x00415D70)
Expand Down
2 changes: 1 addition & 1 deletion src/game/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void __cdecl PrintRooms(int16_t room_number)
r->bound_top = PhdWinMaxY;
}

void TR1MInjectGameDraw()
void Tomb1MInjectGameDraw()
{
INJECT(0x004171E0, PrintRooms);
}
6 changes: 3 additions & 3 deletions src/game/draw.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_DRAW_H
#define TR1MAIN_GAME_DRAW_H
#ifndef TOMB1MAIN_GAME_DRAW_H
#define TOMB1MAIN_GAME_DRAW_H

#include <stdint.h>

Expand All @@ -11,6 +11,6 @@

void __cdecl PrintRooms(int16_t room_number);

void TR1MInjectGameDraw();
void Tomb1MInjectGameDraw();

#endif
4 changes: 2 additions & 2 deletions src/game/effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

void __cdecl FxChainBlock(ITEM_INFO* item)
{
if (TR1MConfig.fix_tihocan_secret_sound) {
if (Tomb1MConfig.fix_tihocan_secret_sound) {
SoundEffect(33, NULL, 0);
FlipEffect = -1;
} else {
Expand All @@ -21,7 +21,7 @@ void __cdecl FxChainBlock(ITEM_INFO* item)
}
}

void TR1MInjectGameEffects()
void Tomb1MInjectGameEffects()
{
INJECT(0x0041AD00, FxChainBlock);
}
6 changes: 3 additions & 3 deletions src/game/effects.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_EFFECTS_H
#define TR1MAIN_GAME_EFFECTS_H
#ifndef TOMB1MAIN_GAME_EFFECTS_H
#define TOMB1MAIN_GAME_EFFECTS_H

#include <stdint.h>
#include "game/types.h"
Expand All @@ -13,6 +13,6 @@

void __cdecl FxChainBlock(ITEM_INFO* item);

void TR1MInjectGameEffects();
void Tomb1MInjectGameEffects();

#endif
10 changes: 5 additions & 5 deletions src/game/health.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ void __cdecl DrawGameInfo()
DrawAirBar();
DrawPickups();

if (TR1MConfig.enable_enemy_healthbar && Lara.target) {
TR1MRenderBar(
if (Tomb1MConfig.enable_enemy_healthbar && Lara.target) {
Tomb1MRenderBar(
Lara.target->hit_points,
Objects[Lara.target->object_number].hit_points
* (SaveGame[0].bonus_flag ? 2 : 1),
TR1M_BAR_ENEMY_HEALTH);
Tomb1M_BAR_ENEMY_HEALTH);
}
}

Expand Down Expand Up @@ -144,7 +144,7 @@ void __cdecl DrawPickups()
pu->duration = 0;
} else {
S_DrawUISprite(
x, y, TR1MGetRenderScale(12288), pu->sprnum, 4096);
x, y, Tomb1MGetRenderScale(12288), pu->sprnum, 4096);
x -= sprite_width;
}
}
Expand All @@ -162,7 +162,7 @@ void __cdecl AddDisplayPickup(int16_t objnum)
}
}

void TR1MInjectGameHealth()
void Tomb1MInjectGameHealth()
{
INJECT(0x0041DD00, DrawGameInfo);
INJECT(0x0041DEA0, DrawHealthBar);
Expand Down
6 changes: 3 additions & 3 deletions src/game/health.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_HEALTH_H
#define TR1MAIN_GAME_HEALTH_H
#ifndef TOMB1MAIN_GAME_HEALTH_H
#define TOMB1MAIN_GAME_HEALTH_H

void __cdecl MakeAmmoString(char* string);
void __cdecl DrawAmmoInfo();
Expand All @@ -10,6 +10,6 @@ void __cdecl AddDisplayPickup(int16_t objnum);
void __cdecl InitialisePickUpDisplay();
void __cdecl DrawPickups();

void TR1MInjectGameHealth();
void Tomb1MInjectGameHealth();

#endif
4 changes: 2 additions & 2 deletions src/game/inv.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_INV_H
#define TR1MAIN_GAME_INV_H
#ifndef TOMB1MAIN_GAME_INV_H
#define TOMB1MAIN_GAME_INV_H

// clang-format off
#define Inv_RemoveItem ((void __cdecl(*)(int16_t item_num))0x004212A0)
Expand Down
2 changes: 1 addition & 1 deletion src/game/items.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void __cdecl InitialiseFXArray()
fx->next_fx = NO_ITEM;
}

void TR1MInjectGameItems()
void Tomb1MInjectGameItems()
{
INJECT(0x00422250, InitialiseFXArray);
}
6 changes: 3 additions & 3 deletions src/game/items.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TR1MAIN_GAME_ITEMS_H
#define TR1MAIN_GAME_ITEMS_H
#ifndef TOMB1MAIN_GAME_ITEMS_H
#define TOMB1MAIN_GAME_ITEMS_H

// clang-format off
#define InitialiseItemArray ((void __cdecl(*)(int item_count))0x00421B10)
Expand All @@ -8,6 +8,6 @@

void __cdecl InitialiseFXArray();

void TR1MInjectGameItems();
void Tomb1MInjectGameItems();

#endif
Loading

0 comments on commit 06f5e7a

Please sign in to comment.