Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing players.c items #51

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 103 additions & 5 deletions kb.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@
"decl": "void data_initialize(data_t *data, char *name, __int16 maximum_count, __int16 size);",
"addr": "0x1191a0"
},
{
"decl": "void *datum_get(data_t *data, datum_index_t index);",
"addr": "0x119320"
},
{
"decl": "void data_verify(data_t *data);",
"addr": "0x1193f0"
Expand All @@ -333,13 +337,21 @@
"decl": "void data_make_invalid(data_t *data);",
"addr": "0x119550"
},
{
"decl": "void datum_delete(data_t *data, datum_index_t index);",
"addr": "0x1196d0"
},
{
"decl": "void data_iterator_new(data_iter_t *iter, data_t *data);",
"addr": "0x1197b0"
},
{
"decl": "void *data_iterator_next(data_iter_t *iterator);",
"addr": "0x119810"
},
{
"decl": "void data_make_valid(data_t *data);",
"addr": "0x119b20"
}
]
},
Expand Down Expand Up @@ -831,6 +843,10 @@
"decl": "bool input_key_is_down(uint16_t);",
"addr": "0xcf560"
},
{
"decl": "bool input_has_gamepad(uint16_t);",
"addr": "0xcf6c0"
},
{
"decl": "void input_update(void);",
"addr": "0xd0120"
Expand Down Expand Up @@ -1084,7 +1100,7 @@
"addr": "0x8a4d0"
},
{
"decl": "void *observer_get_camera(unsigned __int16 local_player_index);",
"decl": "void *observer_get_camera(int16_t local_player_index);",
"addr": "0x8a4e0"
},
{
Expand Down Expand Up @@ -1151,6 +1167,14 @@
"name": "player_control.obj",
"source": "game/player_control.c",
"functions": [
{
"decl": "void player_control_dispose(void);",
"addr": "0xb63f0"
},
{
"decl": "void player_control_new_unit(uint16_t local_player_index, datum_index_t player_index);",
"addr": "0xb6fc0"
},
{
"decl": "void player_control_initialize_for_new_map(void);",
"addr": "0xb85c0"
Expand Down Expand Up @@ -1248,6 +1272,12 @@
{
"name": "players.obj",
"source": "game/players.c",
"data": [
{
"decl": "char unk_46B668[16 * MAXIMUM_NUMBER_OF_LOCAL_PLAYERS];",
"addr": "0x46b668"
}
],
"functions": [
{
"decl": "void players_initialize(void);",
Expand All @@ -1266,19 +1296,87 @@
"addr": "0xba240"
},
{
"decl": "int local_player_set_player_index(unsigned __int16 a1, int a2);",
"decl": "void *machine_get_player_list(int16_t);",
"addr": "0xba270"
},
{
"decl": "bool local_player_exists(int16_t);",
"addr": "0xba2e0"
},
{
"decl": "int find_unused_local_player_index();",
"addr": "0xba340"
},
{
"decl": "void player_delete(datum_index_t);",
"addr": "0xba390"
},
{
"decl": "int16_t players_get_respawn_failure(void);",
"addr": "0xba3b0"
},
{
"decl": "int local_player_get_player_index(int16_t local_player_index);",
"addr": "0xba3c0"
},
{
"decl": "void local_player_set_player_index(int16_t local_player_index, datum_index_t index);",
"addr": "0xba410"
},
{
"decl": "__int16 local_player_count(void);",
"decl": "int16_t local_player_count(void);",
"addr": "0xba4b0"
},
{
"decl": "__int16 local_player_get_next(__int16 a1);",
"decl": "datum_index_t player_index_from_unit_index(datum_index_t);",
"addr": "0xba500"
},
{
"decl": "void player_died(datum_index_t);",
"addr": "0xba550"
},
{
"decl": "bool players_are_all_dead(void);",
"addr": "0xba5e0"
},
{
"decl": "void* players_get_combined_pvs_local(void);",
"addr": "0xba6b0"
},
{
"decl": "void* players_get_combined_pvs(void);",
"addr": "0xba6c0"
},
{
"decl": "void player_input_enable(bool);",
"addr": "0xba6d0"
},
{
"decl": "bool player_input_enabled(void);",
"addr": "0xba6f0"
},
{
"decl": "bool any_player_is_dead(void);",
"addr": "0xba800"
},
{
"decl": "datum_index_t local_player_get_next(datum_index_t local_player);",
"addr": "0xba4c0"
},
{
"decl": "int player_new(unsigned __int16 a1, int a2, unsigned __int16 a3, char *a4);",
"decl": "int players_compute_local_player_count(void);",
"addr": "0xbadf0"
},
{
"decl": "void player_examine_nearby_unit(void);",
"addr": "0xbae10"
},
{
"decl": "void player_reset_action_result(void);",
"addr": "0xbaeb0"
},
{
"decl": "datum_index_t player_new(unsigned __int16 a1, int a2, unsigned __int16 a3, char *a4);",
"addr": "0xbb2f0"
},
{
Expand Down
9 changes: 5 additions & 4 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ extern const char *build_rev;
extern const char *build_date;
extern const char *build_ui_widget_text;

#define NONE -1
#define MAXIMUM_GAMEPADS 4
#define MAXIMUM_NUMBER_OF_LOCAL_PLAYERS 4
#define MAXIMUM_STRING_SIZE 0x2000

#include "types.h"
#include "inlines.h"
#include "decl.h"
Expand All @@ -38,10 +43,6 @@ extern const char *build_ui_widget_text;
#define CLAMP(x, low, high) \
((x) < (low) ? (low) : ((x) > (high) ? (high) : (x)))

#define MAXIMUM_GAMEPADS 4
#define MAXIMUM_NUMBER_OF_LOCAL_PLAYERS 4
#define MAXIMUM_STRING_SIZE 0x2000

static const int _scenario_type_main_menu = 2;

#ifdef DEBUG_BUILD
Expand Down
2 changes: 1 addition & 1 deletion src/halo/game/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void game_initial_pulse()

data_iterator_new(&iter, player_data);
while (data_iterator_next(&iter))
game_engine_player_added(iter.datum_handle);
game_engine_player_added(iter.datum_index.handle);
game_engine_game_starting();
}

Expand Down
Loading