Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
port Random_SeedDraw
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Nov 16, 2023
1 parent 5c01618 commit ebd4306
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
14 changes: 7 additions & 7 deletions docs/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/progress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2711,7 +2711,7 @@ typedef enum GAME_OBJECT_ID {
0044C970 0000001E * int32_t __cdecl Random_GetControl(void);
0044C990 0000000A + void __cdecl Random_SeedControl(int32_t seed);
0044C9A0 0000001E - int32_t __cdecl Random_GetDraw(void);
0044C9C0 0000000A - void __cdecl Random_SeedDraw(int32_t seed);
0044C9C0 0000000A + void __cdecl Random_SeedDraw(int32_t seed);
0044C9D0 00000044 -R void __cdecl GetValidLevelsList(REQUEST_INFO *req);
0044CA20 0000004C -R void __cdecl GetSavedGamesList(REQUEST_INFO *req);
0044CA70 00000233 -R void __cdecl DisplayCredits(void);
Expand Down
5 changes: 5 additions & 0 deletions src/game/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ void __cdecl Random_SeedControl(const int32_t seed)
g_RandControl = seed;
}

void __cdecl Random_SeedDraw(const int32_t seed)
{
g_RandDraw = seed;
}

void __cdecl Random_Seed(void)
{
time_t lt = time(0);
Expand Down
1 change: 1 addition & 0 deletions src/game/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#include <stdint.h>

void __cdecl Random_SeedControl(int32_t seed);
void __cdecl Random_SeedDraw(int32_t seed);
void __cdecl Random_Seed(void);
1 change: 0 additions & 1 deletion src/global/funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@
#define GameStats ((int32_t __cdecl (*)(int32_t levelID))0x0044C850)
#define Random_GetControl ((int32_t __cdecl (*)(void))0x0044C970)
#define Random_GetDraw ((int32_t __cdecl (*)(void))0x0044C9A0)
#define Random_SeedDraw ((void __cdecl (*)(int32_t seed))0x0044C9C0)
#define GetValidLevelsList ((void __cdecl (*)(REQUEST_INFO *req))0x0044C9D0)
#define GetSavedGamesList ((void __cdecl (*)(REQUEST_INFO *req))0x0044CA20)
#define DisplayCredits ((void __cdecl (*)(void))0x0044CA70)
Expand Down
1 change: 1 addition & 0 deletions src/inject_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ static void Inject_Sound(void)
static void Inject_Random(void)
{
INJECT(1, 0x0044C990, Random_SeedControl);
INJECT(1, 0x0044C9C0, Random_SeedDraw);
INJECT(1, 0x0044D870, Random_Seed);
}

Expand Down

0 comments on commit ebd4306

Please sign in to comment.