Files
Cesarus85--mjolnir-vr/source/cache/cache_files_windows.c
T

367 lines
8.9 KiB
C

/*
CACHE_FILES_WINDOWS.C
symbols in this file:
001ABD40 0050:
_cache_files_dispose (0000)
001ABD90 01a0:
_code_001abd90 (0000)
001ABF30 0030:
_code_001abf30 (0000)
001ABF60 0040:
_code_001abf60 (0000)
001ABFA0 0060:
_code_001abfa0 (0000)
001AC000 0080:
_code_001ac000 (0000)
001AC080 0010:
_cache_files_precache_set_priority (0000)
001AC090 0010:
_cache_files_precache_in_progress (0000)
001AC0A0 0030:
_cache_files_precache_is_copying_map (0000)
001AC0D0 0030:
_cache_files_precache_map_queue_end (0000)
001AC100 0040:
_code_001ac100 (0000)
001AC140 0040:
_code_001ac140 (0000)
001AC180 0040:
_code_001ac180 (0000)
001AC1C0 0050:
_code_001ac1c0 (0000)
001AC210 0020:
_code_001ac210 (0000)
001AC230 0010:
_code_001ac230 (0000)
001AC240 0090:
_code_001ac240 (0000)
001AC2D0 0070:
_code_001ac2d0 (0000)
001AC340 0020:
_code_001ac340 (0000)
001AC360 0010:
_code_001ac360 (0000)
001AC370 0010:
_code_001ac370 (0000)
001AC380 0010:
_code_001ac380 (0000)
001AC390 0010:
_code_001ac390 (0000)
001AC3A0 0010:
_code_001ac3a0 (0000)
001AC3B0 0020:
_cache_file_close (0000)
001AC3D0 0150:
_cache_file_read (0000)
001AC520 0050:
_cache_file_promote_read (0000)
001AC570 0090:
_code_001ac570 (0000)
001AC600 0020:
_code_001ac600 (0000)
001AC620 0020:
_code_001ac620 (0000)
001AC640 0060:
_cache_file_block_until_not_busy (0000)
001AC6A0 0060:
_tags_header_register_vertex_and_index_buffers (0000)
001AC700 00b0:
_tags_header_deregister_vertex_and_index_buffers (0000)
001AC7B0 0070:
_structure_bsp_header_register_vertex_buffers (0000)
001AC820 0070:
_structure_bsp_header_deregister_vertex_buffers (0000)
001AC890 0060:
_code_001ac890 (0000)
001AC8F0 00f0:
_code_001ac8f0 (0000)
001AC9E0 00b0:
_cache_files_precache_map_status (0000)
001ACA90 0070:
_code_001aca90 (0000)
001ACB00 0190:
_code_001acb00 (0000)
001ACC90 0060:
_code_001acc90 (0000)
001ACCF0 0190:
_code_001accf0 (0000)
001ACE80 0130:
_code_001ace80 (0000)
001ACFB0 0120:
_cache_file_open (0000)
001AD0D0 02f0:
_code_001ad0d0 (0000)
001AD3C0 0030:
_cache_files_precache_map_loaded (0000)
001AD3F0 0130:
_cache_files_precache_map_begin (0000)
001AD520 0060:
_cache_files_precache_map_end (0000)
001AD580 0080:
_code_001ad580 (0000)
001AD600 0060:
_cache_files_initialize (0000)
002A71F8 002d:
??_C@_0CN@LGGFIMDL@cache_file_globals?4open_map_file@ (0000)
002A7228 002b:
??_C@_0CL@CIGLGOJJ@c?3?2halo?2SOURCE?2cache?2cache_files@ (0000)
002A7254 0020:
??_C@_0CA@OGKEMPOH@Read?1WriteFileEx?$CI?$CJ?5returned?5?$CD?$CFd?$AA@ (0000)
002A7274 0013:
??_C@_0BD@PLJFCFLH@completion_routine?$AA@ (0000)
002A7288 0010:
??_C@_0BA@LMKACIBF@completion_flag?$AA@ (0000)
002A7298 000b:
??_C@_0L@GFMJGGB@overlapped?$AA@ (0000)
002A72A4 001b:
??_C@_0BL@LMFIEMFC@file?$CB?$DNINVALID_HANDLE_VALUE?$AA@ (0000)
002A72C0 0017:
??_C@_0BH@MFHBKAIA@async_request_function?$AA@ (0000)
002A72D8 0046:
??_C@_0EG@KCENDOIE@request_index?$DO?$DN0?5?$CG?$CG?5request_inde@ (0000)
002A7320 002d:
??_C@_0CN@BGBLHKIB@cache_file_globals?4open_map_file@ (0000)
002A7350 0024:
??_C@_0CE@EPABAAJM@cache_file_globals?4copy_in_progr@ (0000)
002A7374 003f:
??_C@_0DP@INCJNNMP@map_file_index?$DO?$DN0?5?$CG?$CG?5map_file_in@ (0000)
002A73B4 0011:
??_C@_0BB@JJFBACKB@z?3?2cache?$CF03d?4map?$AA@ (0000)
002A73C8 0024:
??_C@_0CE@EPGEPEPL@finished_request?9?$DOoverlapped?4hEv@ (0000)
002A73EC 002a:
??_C@_0CK@GKGPAPGO@bytes_transferred?$DN?$DNfinished_requ@ (0000)
002A7418 001a:
??_C@_0BK@GBNCJMGM@error_code?$DN?$DNERROR_SUCCESS?$AA@ (0000)
002A7434 0013:
??_C@_0BD@BDBACLGP@overlapped?9?$DOhEvent?$AA@ (0000)
002A7448 0009:
??_C@_08DCOLLFMA@?$CFs?$CFs?4map?$AA@ (0000)
002A7454 000a:
??_C@_09GPIOEEJE@offset?$DO?$DN0?$AA@ (0000)
002A7460 001a:
??_C@_0BK@OLOIOEMB@completion_flag_reference?$AA@ (0000)
002A747C 002c:
??_C@_0CM@KBEGNHBI@?$CBIDirect3DIndexBuffer8_IsBusy?$CIin@ (0000)
002A74A8 002e:
??_C@_0CO@CGLHMLAM@?$CBIDirect3DVertexBuffer8_IsBusy?$CIv@ (0000)
002A74D8 0015:
??_C@_0BF@COEFPJKL@z?3?2last_language?4dat?$AA@ (0000)
002A74F0 002b:
??_C@_0CL@NILOOFC@couldn?8t?5read?5header?5from?5cache?5@ (0000)
002A751C 003c:
??_C@_0DM@LINBCMFH@cache_file_globals?4open_map_file@ (0000)
002A7558 0017:
??_C@_0BH@BPIEKPLM@?$CBbest_request?9?$DOrunning?$AA@ (0000)
002A7570 0015:
??_C@_0BF@DANPCANK@map_file_index?$CB?$DNNONE?$AA@ (0000)
002A7588 000e:
??_C@_0O@OLMPCHGI@scenario_name?$AA@ (0000)
002A7598 002d:
??_C@_0CN@LAKIIMED@couldn?8t?5open?5or?5create?5new?5cach@ (0000)
002A75C8 0026:
??_C@_0CG@BLEGAMFF@setup?5for?5new?5cache?5file?5failed?5@ (0000)
002A75F0 0014:
??_C@_0BE@KLDNFNMA@full?5path?5name?5?8?$CFs?8?$AA@ (0000)
002A7604 0022:
??_C@_0CC@PCGPBKMC@couldn?8t?5find?5map?5?8?$CFs?8?5on?5the?5DV@ (0000)
002A7628 0020:
??_C@_0CA@GMOAPCML@starting?5precaching?5of?5map?5?8?$CFs?8?$AA@ (0000)
002A7648 001a:
??_C@_0BK@MIGLNFOL@cache_file_globals?4thread?$AA@ (0000)
002A7664 001f:
??_C@_0BP@DJCANAAM@cache_file_globals?4sleep_event?$AA@ (0000)
002A7684 001c:
??_C@_0BM@POLGJDBF@cache_file_globals?4requests?$AA@ (0000)
004CDFF8 307c:
_bss_004cdff8 (0000)
*/
/* ---------- headers */
#include "cseries/cseries.h"
#include "cache/cache_files.h"
/* ---------- constants */
enum
{
MAXIMUM_SIMULTANEOUS_CACHE_REQUESTS = 512,
};
/* ---------- macros */
#define cache_file_globals bss_004cdff8
/* ---------- structures */
struct cache_file_request_prefix
{
byte reserved00[0x1C];
boolean blocking;
boolean pending;
byte reserved1E[2];
};
struct cache_file_runtime_globals_prefix
{
byte cached_map_file_storage[0x3048];
boolean copy_in_progress;
byte reserved3049;
short copying_to_map_file_index;
char copying_to_map_file_name[32];
short open_map_file_index;
short blocking_request_index;
void *sleep_event;
void *thread;
struct cache_file_request_prefix *requests;
};
typedef char verify_cache_file_request_size[
sizeof(struct cache_file_request_prefix) == 0x20 ? 1 : -1];
typedef char verify_cache_file_request_blocking_offset[
offsetof(
struct cache_file_request_prefix,
blocking) == 0x1C ? 1 : -1];
typedef char verify_cache_file_request_pending_offset[
offsetof(
struct cache_file_request_prefix,
pending) == 0x1D ? 1 : -1];
typedef char verify_cache_file_copy_in_progress_offset[
offsetof(
struct cache_file_runtime_globals_prefix,
copy_in_progress) == 0x3048 ? 1 : -1];
typedef char verify_cache_file_copying_map_index_offset[
offsetof(
struct cache_file_runtime_globals_prefix,
copying_to_map_file_index) == 0x304A ? 1 : -1];
typedef char verify_cache_file_copying_map_name_offset[
offsetof(
struct cache_file_runtime_globals_prefix,
copying_to_map_file_name) == 0x304C ? 1 : -1];
typedef char verify_cache_file_open_map_index_offset[
offsetof(
struct cache_file_runtime_globals_prefix,
open_map_file_index) == 0x306C ? 1 : -1];
typedef char verify_cache_file_requests_offset[
offsetof(
struct cache_file_runtime_globals_prefix,
requests) == 0x3078 ? 1 : -1];
/* ---------- prototypes */
void cache_copy_queue_end(
void);
void cache_copy_set_priority(
boolean blocking);
const char *tag_name_strip_path(
const char *name);
unsigned long __stdcall SleepEx(
unsigned long milliseconds,
long alertable);
/* ---------- globals */
extern struct cache_file_runtime_globals_prefix bss_004cdff8;
/* ---------- public code */
void cache_files_dispose(
void)
{
match_assert(
"c:\\halo\\SOURCE\\cache\\cache_files_windows.c",
207,
cache_file_globals.open_map_file_index==NONE);
match_free(
"c:\\halo\\SOURCE\\cache\\cache_files_windows.c",
209,
cache_file_globals.requests);
return;
}
void cache_files_precache_set_priority(
boolean blocking)
{
cache_copy_set_priority(blocking);
return;
}
boolean cache_files_precache_in_progress(
void)
{
return bss_004cdff8.copy_in_progress;
}
boolean cache_files_precache_is_copying_map(
const char *map_name)
{
if (cache_file_globals.copying_to_map_file_index != NONE &&
strcmp(
cache_file_globals.copying_to_map_file_name,
tag_name_strip_path(map_name)) == 0)
{
return TRUE;
}
return FALSE;
}
void cache_files_precache_map_queue_end(
void)
{
match_assert(
"c:\\halo\\SOURCE\\cache\\cache_files_windows.c",
1022,
cache_file_globals.copy_in_progress);
cache_copy_queue_end();
return;
}
void cache_file_promote_read(
short request_index)
{
match_assert(
"c:\\halo\\SOURCE\\cache\\cache_files_windows.c",
614,
request_index>=0 && request_index<MAXIMUM_SIMULTANEOUS_CACHE_REQUESTS);
cache_file_globals.requests[request_index].blocking = TRUE;
return;
}
void cache_file_block_until_not_busy(
void)
{
boolean busy;
short request_index;
do
{
SleepEx(0, TRUE);
busy = FALSE;
for (request_index = 0;
request_index < MAXIMUM_SIMULTANEOUS_CACHE_REQUESTS;
request_index++)
{
match_assert(
"c:\\halo\\SOURCE\\cache\\cache_files_windows.c",
614,
request_index>=0 && request_index<MAXIMUM_SIMULTANEOUS_CACHE_REQUESTS);
if (cache_file_globals.requests[request_index].pending)
{
busy = TRUE;
}
}
}
while (busy);
return;
}
/* ---------- private code */