BrV1dbBeginWrapper_Float call tree (#19)
* Implements BrV1dbBeginWrapper_Float tree calls
This commit is contained in:
parent
c57fc0e0a8
commit
1a5715dc81
|
@ -24,7 +24,7 @@ BraceWrapping:
|
|||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
|
@ -33,7 +33,7 @@ BraceWrapping:
|
|||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeBraces: WebKit
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
|
|
|
@ -1,15 +1,28 @@
|
|||
#include "brbegin.h"
|
||||
|
||||
#include "CORE/HOST/himage.h"
|
||||
#include "CORE/PIXELMAP/pmsetup.h"
|
||||
#include "fwsetup.h"
|
||||
|
||||
br_boolean active;
|
||||
char rscid[54];
|
||||
|
||||
// Offset: 8
|
||||
// Size: 88
|
||||
br_error BrBegin() {
|
||||
if (active) {
|
||||
return 4103;
|
||||
} else {
|
||||
BrFwBegin();
|
||||
HostImageLoad("unk?");
|
||||
BrPixelmapBegin();
|
||||
active = 1;
|
||||
//nullsub_28();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Offset: 102
|
||||
// Size: 126
|
||||
br_error BrEnd() {
|
||||
}
|
||||
|
||||
|
|
|
@ -1,67 +1,79 @@
|
|||
#include "brlists.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
char rscid[49];
|
||||
|
||||
// Offset: 10
|
||||
// Size: 60
|
||||
void BrNewList(br_list *list) {
|
||||
void BrNewList(br_list* list) {
|
||||
list->_null = NULL;
|
||||
list->tail = (br_node*)list;
|
||||
list->head = list->_null;
|
||||
}
|
||||
|
||||
// Offset: 80
|
||||
// Size: 68
|
||||
void BrAddHead(br_list *list, br_node *node) {
|
||||
void BrAddHead(br_list* list, br_node* node) {
|
||||
}
|
||||
|
||||
// Offset: 158
|
||||
// Size: 73
|
||||
void BrAddTail(br_list *list, br_node *node) {
|
||||
void BrAddTail(br_list* list, br_node* node) {
|
||||
}
|
||||
|
||||
// Offset: 241
|
||||
// Size: 77
|
||||
br_node* BrRemHead(br_list *list) {
|
||||
br_node *n;
|
||||
br_node* BrRemHead(br_list* list) {
|
||||
br_node* n;
|
||||
}
|
||||
|
||||
// Offset: 328
|
||||
// Size: 77
|
||||
br_node* BrRemTail(br_list *list) {
|
||||
br_node *n;
|
||||
br_node* BrRemTail(br_list* list) {
|
||||
br_node* n;
|
||||
}
|
||||
|
||||
// Offset: 414
|
||||
// Size: 68
|
||||
void BrInsert(br_list *list, br_node *here, br_node *node) {
|
||||
void BrInsert(br_list* list, br_node* here, br_node* node) {
|
||||
}
|
||||
|
||||
// Offset: 491
|
||||
// Size: 66
|
||||
br_node* BrRemove(br_node *node) {
|
||||
br_node* BrRemove(br_node* node) {
|
||||
}
|
||||
|
||||
// Offset: 573
|
||||
// Size: 39
|
||||
void BrSimpleNewList(br_simple_list *list) {
|
||||
void BrSimpleNewList(br_simple_list* list) {
|
||||
list->head = NULL;
|
||||
}
|
||||
|
||||
// Offset: 628
|
||||
// Size: 76
|
||||
void BrSimpleAddHead(br_simple_list *list, br_simple_node *node) {
|
||||
void BrSimpleAddHead(br_simple_list* list, br_simple_node* node) {
|
||||
node->next = list->head;
|
||||
node->prev = list;
|
||||
if (node->next) {
|
||||
node->next->prev = node;
|
||||
}
|
||||
list->head = node;
|
||||
}
|
||||
|
||||
// Offset: 720
|
||||
// Size: 65
|
||||
br_simple_node* BrSimpleRemHead(br_simple_list *list) {
|
||||
br_simple_node *node;
|
||||
br_simple_node* BrSimpleRemHead(br_simple_list* list) {
|
||||
br_simple_node* node;
|
||||
}
|
||||
|
||||
// Offset: 800
|
||||
// Size: 76
|
||||
void BrSimpleInsert(br_simple_list *list, br_simple_node *here, br_simple_node *node) {
|
||||
void BrSimpleInsert(br_simple_list* list, br_simple_node* here, br_simple_node* node) {
|
||||
}
|
||||
|
||||
// Offset: 891
|
||||
// Size: 93
|
||||
br_simple_node* BrSimpleRemove(br_simple_node *node) {
|
||||
br_simple_node* BrSimpleRemove(br_simple_node* node) {
|
||||
}
|
||||
|
||||
|
|
|
@ -5,50 +5,50 @@
|
|||
|
||||
// Offset: 10
|
||||
// Size: 60
|
||||
void BrNewList(br_list *list);
|
||||
void BrNewList(br_list* list);
|
||||
|
||||
// Offset: 80
|
||||
// Size: 68
|
||||
void BrAddHead(br_list *list, br_node *node);
|
||||
void BrAddHead(br_list* list, br_node* node);
|
||||
|
||||
// Offset: 158
|
||||
// Size: 73
|
||||
void BrAddTail(br_list *list, br_node *node);
|
||||
void BrAddTail(br_list* list, br_node* node);
|
||||
|
||||
// Offset: 241
|
||||
// Size: 77
|
||||
br_node* BrRemHead(br_list *list);
|
||||
br_node* BrRemHead(br_list* list);
|
||||
|
||||
// Offset: 328
|
||||
// Size: 77
|
||||
br_node* BrRemTail(br_list *list);
|
||||
br_node* BrRemTail(br_list* list);
|
||||
|
||||
// Offset: 414
|
||||
// Size: 68
|
||||
void BrInsert(br_list *list, br_node *here, br_node *node);
|
||||
void BrInsert(br_list* list, br_node* here, br_node* node);
|
||||
|
||||
// Offset: 491
|
||||
// Size: 66
|
||||
br_node* BrRemove(br_node *node);
|
||||
br_node* BrRemove(br_node* node);
|
||||
|
||||
// Offset: 573
|
||||
// Size: 39
|
||||
void BrSimpleNewList(br_simple_list *list);
|
||||
void BrSimpleNewList(br_simple_list* list);
|
||||
|
||||
// Offset: 628
|
||||
// Size: 76
|
||||
void BrSimpleAddHead(br_simple_list *list, br_simple_node *node);
|
||||
void BrSimpleAddHead(br_simple_list* list, br_simple_node* node);
|
||||
|
||||
// Offset: 720
|
||||
// Size: 65
|
||||
br_simple_node* BrSimpleRemHead(br_simple_list *list);
|
||||
br_simple_node* BrSimpleRemHead(br_simple_list* list);
|
||||
|
||||
// Offset: 800
|
||||
// Size: 76
|
||||
void BrSimpleInsert(br_simple_list *list, br_simple_node *here, br_simple_node *node);
|
||||
void BrSimpleInsert(br_simple_list* list, br_simple_node* here, br_simple_node* node);
|
||||
|
||||
// Offset: 891
|
||||
// Size: 93
|
||||
br_simple_node* BrSimpleRemove(br_simple_node *node);
|
||||
br_simple_node* BrSimpleRemove(br_simple_node* node);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "diag.h"
|
||||
#include "fwsetup.h"
|
||||
#include "brprintf.h"
|
||||
#include "CORE/STD/brstdlib.h"
|
||||
#include "brprintf.h"
|
||||
#include "fwsetup.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
// Global variables
|
||||
|
@ -10,7 +10,7 @@ char rscid[49];
|
|||
|
||||
// Offset: 10
|
||||
// Size: 118
|
||||
void BrFailure(const char *s, ...) {
|
||||
void BrFailure(const char* s, ...) {
|
||||
va_list args;
|
||||
const char failure_header[10] = "Failure: ";
|
||||
|
||||
|
@ -18,17 +18,17 @@ void BrFailure(const char *s, ...) {
|
|||
BrStrCpy(_diag_scratch, failure_header);
|
||||
BrVSprintf(&_diag_scratch[sizeof(failure_header) - 1], s, args);
|
||||
|
||||
if (fw.err->error == NULL) {
|
||||
if (fw.diag->failure == NULL) {
|
||||
BrAbort();
|
||||
}
|
||||
|
||||
fw.err->error(_diag_scratch);
|
||||
fw.diag->failure(_diag_scratch);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
// Offset: 138
|
||||
// Size: 118
|
||||
void BrWarning(const char *s, ...) {
|
||||
void BrWarning(const char* s, ...) {
|
||||
va_list args;
|
||||
const char warning_header[10] = "Warning: ";
|
||||
|
||||
|
@ -36,50 +36,49 @@ void BrWarning(const char *s, ...) {
|
|||
BrStrCpy(_diag_scratch, warning_header);
|
||||
BrVSprintf(&_diag_scratch[sizeof(warning_header) - 1], s, args);
|
||||
|
||||
if (fw.err->message == NULL) {
|
||||
if (fw.diag->warning == NULL) {
|
||||
BrAbort();
|
||||
}
|
||||
|
||||
fw.err->message(_diag_scratch);
|
||||
fw.diag->warning(_diag_scratch);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
// Offset: 264
|
||||
// Size: 132
|
||||
void BrFatal(const char *name, int line, const char *s, ...) {
|
||||
void BrFatal(const char* name, int line, const char* s, ...) {
|
||||
va_list args;
|
||||
int n;
|
||||
|
||||
va_start(args, s);
|
||||
n = BrSprintf(_diag_scratch, "FATAL %s:%d\n", name, line);
|
||||
BrVSprintf(&_diag_scratch[n], s, args);
|
||||
if (fw.err->error == NULL) {
|
||||
if (fw.diag->failure == NULL) {
|
||||
BrAbort();
|
||||
}
|
||||
|
||||
fw.err->error(_diag_scratch);
|
||||
fw.diag->failure(_diag_scratch);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
// Offset: 406
|
||||
// Size: 95
|
||||
void _BrAssert(const char *condition, const char *file, unsigned int line) {
|
||||
if (fw.err->error == NULL) {
|
||||
void _BrAssert(const char* condition, const char* file, unsigned int line) {
|
||||
if (fw.diag->failure == NULL) {
|
||||
BrAbort();
|
||||
}
|
||||
|
||||
BrSprintf(_diag_scratch, "ASSERTION FAILED %s:%d: \"%s\"\n", file, line, condition);
|
||||
fw.err->error(_diag_scratch);
|
||||
fw.diag->failure(_diag_scratch);
|
||||
}
|
||||
|
||||
// Offset: 512
|
||||
// Size: 95
|
||||
void _BrUAssert(const char *condition, const char *file, unsigned int line) {
|
||||
if (fw.err->error == NULL) {
|
||||
void _BrUAssert(const char* condition, const char* file, unsigned int line) {
|
||||
if (fw.diag->failure == NULL) {
|
||||
BrAbort();
|
||||
}
|
||||
|
||||
BrSprintf(_diag_scratch, "ASSERTION FAILED %s:%d: \"%s\"\n", file, line, condition);
|
||||
fw.err->error(_diag_scratch);
|
||||
fw.diag->failure(_diag_scratch);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,108 @@
|
|||
#include "fwsetup.h"
|
||||
|
||||
br_image Image_BRCORE1;
|
||||
#include "CORE/FW/brlists.h"
|
||||
#include "CORE/FW/file.h"
|
||||
#include "CORE/FW/image.h"
|
||||
#include "CORE/FW/object.h"
|
||||
#include "CORE/FW/register.h"
|
||||
#include "CORE/FW/resource.h"
|
||||
#include "CORE/FW/resreg.h"
|
||||
#include "CORE/FW/sys_conf.h"
|
||||
#include "CORE/FW/token.h"
|
||||
#include "CORE/STD/brstddiag.h"
|
||||
#include "CORE/STD/brstdfile.h"
|
||||
#include "CORE/STD/brstdmem.h"
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
br_framework_state fw;
|
||||
void *functionPointers_BRCORE1[185];
|
||||
char *namePointers_BRCORE1[185];
|
||||
br_resource_class resourceClasses[25];
|
||||
void* functionPointers_BRCORE1[185];
|
||||
char* namePointers_BRCORE1[185];
|
||||
br_resource_class fw_resourceClasses[25] = {
|
||||
{ 0u, "REGISTRY", BR_MEMORY_REGISTRY, NULL, 0u },
|
||||
{ 0u, "ANCHOR", BR_MEMORY_ANCHOR, NULL, 0u },
|
||||
{ 0u, "RESOURCE_CLASS", BR_MEMORY_RESOURCE_CLASS, NULL, 0u },
|
||||
{ 0u, "SCRATCH,", BR_MEMORY_SCRATCH, NULL, 16u },
|
||||
{ 0u, "STRING", BR_MEMORY_STRING, NULL, 1u },
|
||||
{ 0u, "FILE", BR_MEMORY_FILE, &_BrFileFree, 0u },
|
||||
{ 0u, "POOL", BR_MEMORY_POOL, NULL, 16u },
|
||||
{ 0u, "EXCEPTION_HANDLER", BR_MEMORY_EXCEPTION_HANDLER, NULL, 0u },
|
||||
{ 0u, "TOKEN", BR_MEMORY_TOKEN, NULL, 0u },
|
||||
{ 0u, "TOKEN_MAP", BR_MEMORY_TOKEN_MAP, NULL, 8u },
|
||||
{ 0u, "DATAFILE", BR_MEMORY_DATAFILE, NULL, 0u },
|
||||
{ 0u, "LEXER", BR_MEMORY_LEXER, NULL, 0u },
|
||||
{ 0u, "OBJECT_LIST", BR_MEMORY_OBJECT_LIST, NULL, 0u },
|
||||
{ 0u, "OBJECT_LIST_ENTRY", BR_MEMORY_OBJECT_LIST_ENTRY, NULL, 0u },
|
||||
{ 0u, "APPLICATION", BR_MEMORY_APPLICATION, NULL, 0u },
|
||||
{ 0u, "IMAGE", BR_MEMORY_IMAGE, &_BrImageFree, 0u },
|
||||
{ 0u, "IMAGE_ARENA", BR_MEMORY_IMAGE_ARENA, NULL, 0u },
|
||||
{ 0u, "IMAGE_SECTIONS", BR_MEMORY_IMAGE_SECTIONS, NULL, 0u },
|
||||
{ 0u, "IMAGE_NAMES", BR_MEMORY_IMAGE_NAMES, NULL, 0u },
|
||||
{ 0u, "OBJECT", BR_MEMORY_OBJECT, &_BrObjectFree, 16u },
|
||||
{ 0u, "OBJECT_DATA", BR_MEMORY_OBJECT_DATA, NULL, 16u },
|
||||
{ 0u, "DRIVER", BR_MEMORY_DRIVER, NULL, 0u },
|
||||
{ 0u, "FMT_RESULTS", BR_MEMORY_FMT_RESULTS, NULL, 0u },
|
||||
{ 0u, "TOKEN_VALUE", BR_MEMORY_TOKEN_VALUE, NULL, 0u },
|
||||
{ 0u, "TOKEN_TEMPLATE", BR_MEMORY_TOKEN_TEMPLATE, NULL, 0u }
|
||||
};
|
||||
|
||||
br_uint_16 nameOrdinals_BRCORE1[185];
|
||||
|
||||
br_image Image_BRCORE1 = {
|
||||
{},
|
||||
"BRCORE1",
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
185,
|
||||
&functionPointers_BRCORE1,
|
||||
185,
|
||||
&namePointers_BRCORE1,
|
||||
nameOrdinals_BRCORE1,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
char rscid[53];
|
||||
|
||||
#define NBR_DEV_SLOTS 16
|
||||
|
||||
// Offset: 10
|
||||
// Size: 324
|
||||
br_error BrFwBegin() {
|
||||
int i;
|
||||
|
||||
if (fw.active) {
|
||||
return 4103;
|
||||
}
|
||||
|
||||
if (!fw.diag)
|
||||
fw.diag = _BrDefaultDiagHandler;
|
||||
if (!fw.fsys)
|
||||
fw.fsys = _BrDefaultFilesystem;
|
||||
if (!fw.mem)
|
||||
fw.mem = _BrDefaultAllocator;
|
||||
fw.open_mode = 0;
|
||||
BrRegistryNew(&fw.reg_resource_classes);
|
||||
|
||||
fw.resource_class_index[BR_MEMORY_REGISTRY] = &fw_resourceClasses[0];
|
||||
fw.resource_class_index[BR_MEMORY_ANCHOR] = &fw_resourceClasses[1];
|
||||
fw.res = BrResAllocate(0, 0, BR_MEMORY_ANCHOR);
|
||||
for (i = 0; i < 25; i++) {
|
||||
BrResClassAdd(&fw_resourceClasses[i]);
|
||||
}
|
||||
BrNewList(&fw.images);
|
||||
fw.dev_slots = (br_open_device*)BrResAllocate(fw.res, sizeof(br_open_device) * NBR_DEV_SLOTS, BR_MEMORY_OBJECT_DATA);
|
||||
fw.ndev_slots = NBR_DEV_SLOTS;
|
||||
fw.active = 1;
|
||||
BrTokenBegin();
|
||||
BrSystemConfigBegin();
|
||||
fw.bAlreadyLoadedDrivers = 0;
|
||||
BrImageAdd(&Image_BRCORE1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Offset: 342
|
||||
|
@ -20,19 +112,18 @@ br_error BrFwEnd() {
|
|||
|
||||
// Offset: 466
|
||||
// Size: 73
|
||||
br_diaghandler* BrDiagHandlerSet(br_diaghandler *newdh) {
|
||||
br_diaghandler *old;
|
||||
br_diaghandler* BrDiagHandlerSet(br_diaghandler* newdh) {
|
||||
br_diaghandler* old;
|
||||
}
|
||||
|
||||
// Offset: 555
|
||||
// Size: 73
|
||||
br_filesystem* BrFilesystemSet(br_filesystem *newfs) {
|
||||
br_filesystem *old;
|
||||
br_filesystem* BrFilesystemSet(br_filesystem* newfs) {
|
||||
br_filesystem* old;
|
||||
}
|
||||
|
||||
// Offset: 643
|
||||
// Size: 73
|
||||
br_allocator* BrAllocatorSet(br_allocator *newal) {
|
||||
br_allocator *old;
|
||||
br_allocator* BrAllocatorSet(br_allocator* newal) {
|
||||
br_allocator* old;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
#include "mem.h"
|
||||
|
||||
#include "CORE/FW/fwsetup.h"
|
||||
#include "CORE/STD/brstdlib.h"
|
||||
|
||||
char rscid[45];
|
||||
|
||||
// Offset: 14
|
||||
// Size: 153
|
||||
void* BrMemAllocate(br_size_t size, br_uint_8 type) {
|
||||
void *b;
|
||||
void* b;
|
||||
b = fw.mem->allocate(size, type);
|
||||
BrMemSet(b, 0, size);
|
||||
return b;
|
||||
}
|
||||
|
||||
// Offset: 177
|
||||
// Size: 106
|
||||
void BrMemFree(void *block) {
|
||||
void BrMemFree(void* block) {
|
||||
}
|
||||
|
||||
// Offset: 296
|
||||
|
@ -22,19 +28,22 @@ br_size_t BrMemInquire(br_uint_8 type) {
|
|||
// Offset: 438
|
||||
// Size: 116
|
||||
br_int_32 BrMemAlign(br_uint_8 type) {
|
||||
br_int_32 i;
|
||||
br_int_32 i = 0;
|
||||
if (fw.mem->align) {
|
||||
i = fw.mem->align(type);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
// Offset: 566
|
||||
// Size: 161
|
||||
void* BrMemCalloc(int nelems, br_size_t size, br_uint_8 type) {
|
||||
void *b;
|
||||
void* b;
|
||||
}
|
||||
|
||||
// Offset: 739
|
||||
// Size: 120
|
||||
char* BrMemStrDup(char *str) {
|
||||
char* BrMemStrDup(char* str) {
|
||||
int l;
|
||||
char *nstr;
|
||||
char* nstr;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,26 +1,38 @@
|
|||
#include "register.h"
|
||||
|
||||
#include "brlists.h"
|
||||
#include "fwsetup.h"
|
||||
#include "resource.h"
|
||||
|
||||
char rscid[50];
|
||||
|
||||
// Offset: 14
|
||||
// Size: 96
|
||||
// EAX: reg
|
||||
void* BrRegistryNew(br_registry *reg) {
|
||||
void* BrRegistryNew(br_registry* reg) {
|
||||
BrNewList((br_list*)reg);
|
||||
reg->count = 0;
|
||||
}
|
||||
|
||||
// Offset: 126
|
||||
// Size: 126
|
||||
// EAX: reg
|
||||
void* BrRegistryClear(br_registry *reg) {
|
||||
br_registry_entry *e;
|
||||
void* BrRegistryClear(br_registry* reg) {
|
||||
br_registry_entry* e;
|
||||
}
|
||||
|
||||
// Offset: 266
|
||||
// Size: 159
|
||||
// EAX: reg
|
||||
// EDX: item
|
||||
void* BrRegistryAdd(br_registry *reg, void *item) {
|
||||
br_registry_entry *e;
|
||||
void* BrRegistryAdd(br_registry* reg, void* item) {
|
||||
br_registry_entry* e;
|
||||
|
||||
e = (br_registry_entry*)BrResAllocate(fw.res, sizeof(br_registry_entry), BR_MEMORY_REGISTRY);
|
||||
e->item = (void**)&item;
|
||||
BrAddHead(®->list, &e->node);
|
||||
reg->count++;
|
||||
return item;
|
||||
}
|
||||
|
||||
// Offset: 443
|
||||
|
@ -28,7 +40,7 @@ void* BrRegistryAdd(br_registry *reg, void *item) {
|
|||
// EAX: reg
|
||||
// EDX: items
|
||||
// EBX: n
|
||||
int BrRegistryAddMany(br_registry *reg, void **items, int n) {
|
||||
int BrRegistryAddMany(br_registry* reg, void** items, int n) {
|
||||
int i;
|
||||
}
|
||||
|
||||
|
@ -36,9 +48,9 @@ int BrRegistryAddMany(br_registry *reg, void **items, int n) {
|
|||
// Size: 198
|
||||
// EAX: reg
|
||||
// EDX: item
|
||||
void* BrRegistryRemove(br_registry *reg, void *item) {
|
||||
br_registry_entry *e;
|
||||
void *r;
|
||||
void* BrRegistryRemove(br_registry* reg, void* item) {
|
||||
br_registry_entry* e;
|
||||
void* r;
|
||||
}
|
||||
|
||||
// Offset: 827
|
||||
|
@ -46,7 +58,7 @@ void* BrRegistryRemove(br_registry *reg, void *item) {
|
|||
// EAX: reg
|
||||
// EDX: items
|
||||
// EBX: n
|
||||
int BrRegistryRemoveMany(br_registry *reg, void **items, int n) {
|
||||
int BrRegistryRemoveMany(br_registry* reg, void** items, int n) {
|
||||
int i;
|
||||
int r;
|
||||
}
|
||||
|
@ -55,8 +67,8 @@ int BrRegistryRemoveMany(br_registry *reg, void **items, int n) {
|
|||
// Size: 172
|
||||
// EAX: reg
|
||||
// EDX: pattern
|
||||
void* BrRegistryFind(br_registry *reg, char *pattern) {
|
||||
br_registry_entry *e;
|
||||
void* BrRegistryFind(br_registry* reg, char* pattern) {
|
||||
br_registry_entry* e;
|
||||
}
|
||||
|
||||
// Offset: 1204
|
||||
|
@ -65,8 +77,8 @@ void* BrRegistryFind(br_registry *reg, char *pattern) {
|
|||
// EDX: pattern
|
||||
// EBX: items
|
||||
// ECX: max
|
||||
int BrRegistryFindMany(br_registry *reg, char *pattern, void **items, int max) {
|
||||
br_registry_entry *e;
|
||||
int BrRegistryFindMany(br_registry* reg, char* pattern, void** items, int max) {
|
||||
br_registry_entry* e;
|
||||
int n;
|
||||
}
|
||||
|
||||
|
@ -74,8 +86,8 @@ int BrRegistryFindMany(br_registry *reg, char *pattern, void **items, int max) {
|
|||
// Size: 163
|
||||
// EAX: reg
|
||||
// EDX: pattern
|
||||
int BrRegistryCount(br_registry *reg, char *pattern) {
|
||||
br_registry_entry *e;
|
||||
int BrRegistryCount(br_registry* reg, char* pattern) {
|
||||
br_registry_entry* e;
|
||||
int n;
|
||||
}
|
||||
|
||||
|
@ -85,8 +97,8 @@ int BrRegistryCount(br_registry *reg, char *pattern) {
|
|||
// EDX: pattern
|
||||
// EBX: callback
|
||||
// ECX: arg
|
||||
int BrRegistryEnum(br_registry *reg, char *pattern, br_enum_cbfn *callback, void *arg) {
|
||||
br_registry_entry *e;
|
||||
int BrRegistryEnum(br_registry* reg, char* pattern, br_enum_cbfn* callback, void* arg) {
|
||||
br_registry_entry* e;
|
||||
int r;
|
||||
}
|
||||
|
||||
|
@ -95,7 +107,7 @@ int BrRegistryEnum(br_registry *reg, char *pattern, br_enum_cbfn *callback, void
|
|||
// EAX: reg
|
||||
// EDX: base
|
||||
// EBX: limit
|
||||
void* BrRegistryNewStatic(br_registry *reg, br_registry_entry *base, int limit) {
|
||||
void* BrRegistryNewStatic(br_registry* reg, br_registry_entry* base, int limit) {
|
||||
}
|
||||
|
||||
// Offset: 1907
|
||||
|
@ -103,13 +115,12 @@ void* BrRegistryNewStatic(br_registry *reg, br_registry_entry *base, int limit)
|
|||
// EAX: reg
|
||||
// EDX: base
|
||||
// EBX: item
|
||||
void* BrRegistryAddStatic(br_registry *reg, br_registry_entry *base, void *item) {
|
||||
void* BrRegistryAddStatic(br_registry* reg, br_registry_entry* base, void* item) {
|
||||
}
|
||||
|
||||
// Offset: 1979
|
||||
// Size: 48
|
||||
// EAX: reg
|
||||
// EDX: item
|
||||
void* BrRegistryRemoveStatic(br_registry *reg, void *item) {
|
||||
void* BrRegistryRemoveStatic(br_registry* reg, void* item) {
|
||||
}
|
||||
|
||||
|
|
|
@ -1,114 +1,159 @@
|
|||
#include "resource.h"
|
||||
|
||||
#include "brlists.h"
|
||||
#include "fwsetup.h"
|
||||
#include "mem.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
char rscid[51];
|
||||
|
||||
// Offset: 10
|
||||
// Size: 188
|
||||
// EAX: r
|
||||
void* ResToUser(resource_header *r) {
|
||||
void* ResToUser(resource_header* r) {
|
||||
br_int_32 align;
|
||||
}
|
||||
|
||||
// Offset: 208
|
||||
// Size: 72
|
||||
// EAX: r
|
||||
resource_header* UserToRes(void *r) {
|
||||
br_uint_8 *p;
|
||||
resource_header* UserToRes(void* r) {
|
||||
br_uint_8* p;
|
||||
}
|
||||
|
||||
// Offset: 294
|
||||
// Size: 459
|
||||
void* BrResAllocate(void *vparent, br_size_t size, br_uint_8 res_class) {
|
||||
resource_header *res;
|
||||
resource_header *parent;
|
||||
void* BrResAllocate(void* vparent, br_size_t size, br_uint_8 res_class) {
|
||||
resource_header* res;
|
||||
resource_header* parent;
|
||||
br_int_32 malign;
|
||||
br_int_32 calign;
|
||||
br_int_32 pad;
|
||||
br_int_32 actual_pad;
|
||||
|
||||
br_int_32 actual_pad_2;
|
||||
char* tmp;
|
||||
|
||||
malign = BrMemAlign(res_class) - 1;
|
||||
//printf("BrResAllocate: parent: %p, size: %d, class: %d, class_index: %p\n", vparent, size, res_class, fw.resource_class_index[res_class]);
|
||||
calign = fw.resource_class_index[res_class]->alignment;
|
||||
if (calign <= 0) {
|
||||
calign = 4;
|
||||
}
|
||||
malign--;
|
||||
calign--;
|
||||
|
||||
pad = (~malign & calign) + 3;
|
||||
actual_pad = (sizeof(resource_header) + pad) & 0xFFFC;
|
||||
actual_pad_2 = (size + sizeof(resource_header) + 3) & 0xFFFC;
|
||||
|
||||
res = (resource_header*)BrMemAllocate(size + actual_pad, res_class);
|
||||
// TOOD: ?
|
||||
// if ((signed int)(((unsigned int)((char*)allocated + res_align_1) & ~res_align_1) - (_DWORD)allocated) > v8)
|
||||
// BrFailure((int)"Memory allocator broke alignment", v14);
|
||||
res->class = res_class;
|
||||
res->size_l = actual_pad_2 >> 2;
|
||||
res->size_m = actual_pad_2 >> 10;
|
||||
res->size_h = actual_pad_2 >> 18;
|
||||
BrSimpleNewList(&res->children);
|
||||
res->magic_ptr = res;
|
||||
res->magic_num = 0xDEADBEEF;
|
||||
|
||||
if (vparent) {
|
||||
tmp = vparent;
|
||||
while (*(tmp - 1) == 0) {
|
||||
tmp--;
|
||||
}
|
||||
parent = (resource_header*)(tmp - sizeof(resource_header));
|
||||
BrSimpleAddHead(&parent->children, &res->node);
|
||||
}
|
||||
//printf("BrResAllocate returning res: %p, pad: %d, result: %p\n", res, pad, ((char*)res) + actual_pad);
|
||||
return ((char*)res) + actual_pad;
|
||||
}
|
||||
|
||||
// Offset: 771
|
||||
// Size: 367
|
||||
// EAX: res
|
||||
// EDX: callback
|
||||
void BrResInternalFree(resource_header *res, br_boolean callback) {
|
||||
void BrResInternalFree(resource_header* res, br_boolean callback) {
|
||||
int c;
|
||||
void *r;
|
||||
void* r;
|
||||
}
|
||||
|
||||
// Offset: 1148
|
||||
// Size: 79
|
||||
void BrResFree(void *vres) {
|
||||
void BrResFree(void* vres) {
|
||||
}
|
||||
|
||||
// Offset: 1247
|
||||
// Size: 76
|
||||
void BrResFreeNoCallback(void *vres) {
|
||||
void BrResFreeNoCallback(void* vres) {
|
||||
}
|
||||
|
||||
// Offset: 1332
|
||||
// Size: 259
|
||||
void* BrResAdd(void *vparent, void *vres) {
|
||||
resource_header *res;
|
||||
resource_header *parent;
|
||||
void* BrResAdd(void* vparent, void* vres) {
|
||||
resource_header* res;
|
||||
resource_header* parent;
|
||||
}
|
||||
|
||||
// Offset: 1603
|
||||
// Size: 141
|
||||
void* BrResRemove(void *vres) {
|
||||
resource_header *res;
|
||||
void* BrResRemove(void* vres) {
|
||||
resource_header* res;
|
||||
}
|
||||
|
||||
// Offset: 1755
|
||||
// Size: 132
|
||||
br_uint_8 BrResClass(void *vres) {
|
||||
resource_header *res;
|
||||
br_uint_8 BrResClass(void* vres) {
|
||||
resource_header* res;
|
||||
}
|
||||
|
||||
// Offset: 1900
|
||||
// Size: 266
|
||||
br_boolean BrResIsChild(void *vparent, void *vchild) {
|
||||
resource_header *parent;
|
||||
resource_header *child;
|
||||
resource_header *cp;
|
||||
br_boolean BrResIsChild(void* vparent, void* vchild) {
|
||||
resource_header* parent;
|
||||
resource_header* child;
|
||||
resource_header* cp;
|
||||
}
|
||||
|
||||
// Offset: 2176
|
||||
// Size: 177
|
||||
br_uint_32 BrResSize(void *vres) {
|
||||
resource_header *res;
|
||||
br_uint_32 BrResSize(void* vres) {
|
||||
resource_header* res;
|
||||
}
|
||||
|
||||
// Offset: 2366
|
||||
// Size: 80
|
||||
br_uint_32 ResSizeTotal(void *vres, br_uint_32 *ptotal) {
|
||||
br_uint_32 ResSizeTotal(void* vres, br_uint_32* ptotal) {
|
||||
}
|
||||
|
||||
// Offset: 2461
|
||||
// Size: 62
|
||||
br_uint_32 BrResSizeTotal(void *vres) {
|
||||
br_uint_32 BrResSizeTotal(void* vres) {
|
||||
br_uint_32 total;
|
||||
}
|
||||
|
||||
// Offset: 2538
|
||||
// Size: 226
|
||||
br_uint_32 BrResChildEnum(void *vres, br_resenum_cbfn *callback, void *arg) {
|
||||
resource_header *res;
|
||||
resource_header *rp;
|
||||
br_uint_32 BrResChildEnum(void* vres, br_resenum_cbfn* callback, void* arg) {
|
||||
resource_header* res;
|
||||
resource_header* rp;
|
||||
br_uint_32 r;
|
||||
}
|
||||
|
||||
// Offset: 2775
|
||||
// Size: 91
|
||||
br_uint_32 BrResCheck(void *vres, int no_tag) {
|
||||
resource_header *res;
|
||||
br_uint_32 BrResCheck(void* vres, int no_tag) {
|
||||
resource_header* res;
|
||||
}
|
||||
|
||||
// Offset: 2878
|
||||
// Size: 127
|
||||
char* BrResStrDup(void *vparent, char *str) {
|
||||
char* BrResStrDup(void* vparent, char* str) {
|
||||
int l;
|
||||
char *nstr;
|
||||
char* nstr;
|
||||
}
|
||||
|
||||
// Offset: 3026
|
||||
|
@ -117,22 +162,21 @@ char* BrResStrDup(void *vparent, char *str) {
|
|||
// EDX: putline
|
||||
// EBX: arg
|
||||
// ECX: level
|
||||
void InternalResourceDump(resource_header *res, br_putline_cbfn *putline, void *arg, int level) {
|
||||
void InternalResourceDump(resource_header* res, br_putline_cbfn* putline, void* arg, int level) {
|
||||
int i;
|
||||
char *cp;
|
||||
resource_header *child;
|
||||
br_resource_class *rclass;
|
||||
char* cp;
|
||||
resource_header* child;
|
||||
br_resource_class* rclass;
|
||||
}
|
||||
|
||||
// Offset: 3349
|
||||
// Size: 57
|
||||
void BrResDump(void *vres, br_putline_cbfn *putline, void *arg) {
|
||||
resource_header *res;
|
||||
void BrResDump(void* vres, br_putline_cbfn* putline, void* arg) {
|
||||
resource_header* res;
|
||||
}
|
||||
|
||||
// Offset: 3427
|
||||
// Size: 80
|
||||
char* BrResClassIdentifier(br_uint_8 res_class) {
|
||||
br_resource_class *rclass;
|
||||
br_resource_class* rclass;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,55 +1,68 @@
|
|||
#include "resreg.h"
|
||||
|
||||
#include "CORE/FW/fwsetup.h"
|
||||
#include "CORE/FW/register.h"
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
char rscid[48];
|
||||
|
||||
// Offset: 14
|
||||
// Size: 176
|
||||
br_resource_class* BrResClassAdd(br_resource_class *rclass) {
|
||||
br_resource_class *r;
|
||||
br_resource_class* BrResClassAdd(br_resource_class* rclass) {
|
||||
br_resource_class* r;
|
||||
|
||||
//printf("BrResClassAdd: id: %s, %d = %p\n", rclass->identifier, rclass->res_class, fw.resource_class_index[rclass->res_class]);
|
||||
|
||||
r = BrRegistryAdd(&fw.reg_resource_classes, rclass);
|
||||
if (!r) {
|
||||
return NULL;
|
||||
}
|
||||
fw.resource_class_index[rclass->res_class] = r;
|
||||
return r;
|
||||
}
|
||||
|
||||
// Offset: 207
|
||||
// Size: 158
|
||||
br_resource_class* BrResClassRemove(br_resource_class *rclass) {
|
||||
br_resource_class *r;
|
||||
br_resource_class* BrResClassRemove(br_resource_class* rclass) {
|
||||
br_resource_class* r;
|
||||
}
|
||||
|
||||
// Offset: 380
|
||||
// Size: 49
|
||||
br_resource_class* BrResClassFind(char *pattern) {
|
||||
br_resource_class* BrResClassFind(char* pattern) {
|
||||
}
|
||||
|
||||
// Offset: 448
|
||||
// Size: 55
|
||||
br_resclass_find_cbfn* BrResClassFindHook(br_resclass_find_cbfn *hook) {
|
||||
br_resclass_find_cbfn *old;
|
||||
br_resclass_find_cbfn* BrResClassFindHook(br_resclass_find_cbfn* hook) {
|
||||
br_resclass_find_cbfn* old;
|
||||
}
|
||||
|
||||
// Offset: 521
|
||||
// Size: 83
|
||||
br_uint_32 BrResClassAddMany(br_resource_class **items, int n) {
|
||||
br_uint_32 BrResClassAddMany(br_resource_class** items, int n) {
|
||||
int i;
|
||||
}
|
||||
|
||||
// Offset: 625
|
||||
// Size: 100
|
||||
br_uint_32 BrResClassRemoveMany(br_resource_class **items, int n) {
|
||||
br_uint_32 BrResClassRemoveMany(br_resource_class** items, int n) {
|
||||
int i;
|
||||
int r;
|
||||
}
|
||||
|
||||
// Offset: 744
|
||||
// Size: 55
|
||||
br_uint_32 BrResClassFindMany(char *pattern, br_resource_class **items, int max) {
|
||||
br_uint_32 BrResClassFindMany(char* pattern, br_resource_class** items, int max) {
|
||||
}
|
||||
|
||||
// Offset: 815
|
||||
// Size: 49
|
||||
br_uint_32 BrResClassCount(char *pattern) {
|
||||
br_uint_32 BrResClassCount(char* pattern) {
|
||||
}
|
||||
|
||||
// Offset: 879
|
||||
// Size: 55
|
||||
br_uint_32 BrResClassEnum(char *pattern, br_resclass_enum_cbfn *callback, void *arg) {
|
||||
br_uint_32 BrResClassEnum(char* pattern, br_resclass_enum_cbfn* callback, void* arg) {
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ br_boolean Is_Valid_Sys_Config_Token(br_token t) {
|
|||
// EDX: section_name
|
||||
// EBX: t
|
||||
// ECX: Entry
|
||||
br_boolean LoadIniEntry(char *ini_file, char *section_name, br_token t, char *Entry) {
|
||||
br_boolean LoadIniEntry(char* ini_file, char* section_name, br_token t, char* Entry) {
|
||||
char Temp[255];
|
||||
br_uint_16 size;
|
||||
br_value v;
|
||||
|
@ -27,7 +27,7 @@ br_boolean LoadIniEntry(char *ini_file, char *section_name, br_token t, char *En
|
|||
// Size: 213
|
||||
// EAX: ini_file
|
||||
// EDX: section_name
|
||||
br_error LoadIniConfig(char *ini_file, char *section_name) {
|
||||
br_error LoadIniConfig(char* ini_file, char* section_name) {
|
||||
}
|
||||
|
||||
// Offset: 520
|
||||
|
@ -36,7 +36,7 @@ br_error LoadIniConfig(char *ini_file, char *section_name) {
|
|||
// EDX: hKey
|
||||
// EBX: t
|
||||
// ECX: Entry
|
||||
br_boolean LoadRegistryEntry(char *Reg_Path, void *hKey, br_token t, char *Entry) {
|
||||
br_boolean LoadRegistryEntry(char* Reg_Path, void* hKey, br_token t, char* Entry) {
|
||||
char Temp[255];
|
||||
br_uint_16 size;
|
||||
br_value v;
|
||||
|
@ -47,14 +47,14 @@ br_boolean LoadRegistryEntry(char *Reg_Path, void *hKey, br_token t, char *Entry
|
|||
// Size: 224
|
||||
// EAX: Reg_Path
|
||||
// EDX: hKey
|
||||
br_error LoadRegistryConfig(char *Reg_Path, void *hKey) {
|
||||
br_error LoadRegistryConfig(char* Reg_Path, void* hKey) {
|
||||
}
|
||||
|
||||
// Offset: 912
|
||||
// Size: 193
|
||||
// EAX: t
|
||||
// EDX: Entry
|
||||
br_error BrSetDefaultConfig(br_token t, char *Entry) {
|
||||
br_error BrSetDefaultConfig(br_token t, char* Entry) {
|
||||
char Reg_Path[255];
|
||||
int v0;
|
||||
int v1;
|
||||
|
@ -71,20 +71,19 @@ br_error BrSystemConfigBegin() {
|
|||
|
||||
// Offset: 1472
|
||||
// Size: 188
|
||||
br_error BrSystemConfigLoad(br_token t, char *Param1, void *Param2) {
|
||||
br_error BrSystemConfigLoad(br_token t, char* Param1, void* Param2) {
|
||||
br_error r;
|
||||
}
|
||||
|
||||
// Offset: 1684
|
||||
// Size: 158
|
||||
br_error BrSystemConfigSetString(br_token t, char *string) {
|
||||
br_error BrSystemConfigSetString(br_token t, char* string) {
|
||||
br_value v;
|
||||
}
|
||||
|
||||
// Offset: 1868
|
||||
// Size: 175
|
||||
br_error BrSystemConfigQueryString(br_token t, char *string, int max_size) {
|
||||
br_error BrSystemConfigQueryString(br_token t, char* string, int max_size) {
|
||||
br_error r;
|
||||
br_value v;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,19 +1,35 @@
|
|||
#include "pmsetup.h"
|
||||
#include "CORE/FW/resource.h"
|
||||
#include "CORE/FW/resreg.h"
|
||||
#include "CORE/STD/brstdlib.h"
|
||||
#include "image.h"
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
br_image Image_BRPMAP1;
|
||||
br_resource_class resourceClasses[2];
|
||||
void *functionPointers_BRPMAP1[77];
|
||||
char *namePointers_BRPMAP1[77];
|
||||
br_resource_class pm_resourceClasses[2] = {
|
||||
{ 0u, "PIXELMAP", BR_MEMORY_PIXELMAP, NULL, 0u },
|
||||
{ 0u, "PIXELS", BR_MEMORY_PIXELS, NULL, 32u }
|
||||
};
|
||||
void* functionPointers_BRPMAP1[77];
|
||||
char* namePointers_BRPMAP1[77];
|
||||
br_pixelmap_state _pixelmap;
|
||||
br_uint_16 nameOrdinals_BRPMAP1[77];
|
||||
|
||||
// Offset: 16
|
||||
// Size: 130
|
||||
void BrPixelmapBegin() {
|
||||
int i;
|
||||
|
||||
BrMemSet(&_pixelmap, 0, sizeof(br_pixelmap_state));
|
||||
_pixelmap.res = BrResAllocate(0, 0, BR_MEMORY_ANCHOR);
|
||||
for (i = 0; i < 2; i++) {
|
||||
BrResClassAdd(&pm_resourceClasses[i]);
|
||||
}
|
||||
return BrImageAdd(&Image_BRPMAP1);
|
||||
}
|
||||
|
||||
// Offset: 160
|
||||
// Size: 76
|
||||
void BrPixelmapEnd() {
|
||||
}
|
||||
|
||||
|
|
|
@ -3,12 +3,15 @@
|
|||
|
||||
#include "br_types.h"
|
||||
|
||||
extern br_diaghandler BrStdioDiagHandler;
|
||||
extern br_diaghandler* _BrDefaultDiagHandler;
|
||||
|
||||
// Offset: 15
|
||||
// Size: 78
|
||||
void BrStdioWarning(char *message);
|
||||
void BrStdioWarning(char* message);
|
||||
|
||||
// Offset: 108
|
||||
// Size: 93
|
||||
void BrStdioFailure(char *message);
|
||||
void BrStdioFailure(char* message);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "br_types.h"
|
||||
|
||||
extern br_filesystem *_BrDefaultFilesystem;
|
||||
extern br_filesystem* _BrDefaultFilesystem;
|
||||
|
||||
// Offset: 18
|
||||
// Size: 40
|
||||
|
@ -11,46 +11,46 @@ br_uint_32 BrStdioAttributes();
|
|||
|
||||
// Offset: 74
|
||||
// Size: 595
|
||||
void* BrStdioOpenRead(char *name, br_size_t n_magics, br_mode_test_cbfn *identify, int *mode_result);
|
||||
void* BrStdioOpenRead(char* name, br_size_t n_magics, br_mode_test_cbfn* identify, int* mode_result);
|
||||
|
||||
// Offset: 686
|
||||
// Size: 82
|
||||
void* BrStdioOpenWrite(char *name, int mode);
|
||||
void* BrStdioOpenWrite(char* name, int mode);
|
||||
|
||||
// Offset: 781
|
||||
// Size: 38
|
||||
void BrStdioClose(void *f);
|
||||
void BrStdioClose(void* f);
|
||||
|
||||
// Offset: 830
|
||||
// Size: 45
|
||||
int BrStdioEof(void *f);
|
||||
int BrStdioEof(void* f);
|
||||
|
||||
// Offset: 890
|
||||
// Size: 117
|
||||
int BrStdioGetChar(void *f);
|
||||
int BrStdioGetChar(void* f);
|
||||
|
||||
// Offset: 1022
|
||||
// Size: 41
|
||||
void BrStdioPutChar(int c, void *f);
|
||||
void BrStdioPutChar(int c, void* f);
|
||||
|
||||
// Offset: 1075
|
||||
// Size: 53
|
||||
br_size_t BrStdioRead(void *buf, br_size_t size, unsigned int n, void *f);
|
||||
br_size_t BrStdioRead(void* buf, br_size_t size, unsigned int n, void* f);
|
||||
|
||||
// Offset: 1141
|
||||
// Size: 53
|
||||
br_size_t BrStdioWrite(void *buf, br_size_t size, unsigned int n, void *f);
|
||||
br_size_t BrStdioWrite(void* buf, br_size_t size, unsigned int n, void* f);
|
||||
|
||||
// Offset: 1209
|
||||
// Size: 141
|
||||
br_size_t BrStdioGetLine(char *buf, br_size_t buf_len, void *f);
|
||||
br_size_t BrStdioGetLine(char* buf, br_size_t buf_len, void* f);
|
||||
|
||||
// Offset: 1365
|
||||
// Size: 54
|
||||
void BrStdioPutLine(char *buf, void *f);
|
||||
void BrStdioPutLine(char* buf, void* f);
|
||||
|
||||
// Offset: 1434
|
||||
// Size: 46
|
||||
void BrStdioAdvance(br_size_t count, void *f);
|
||||
void BrStdioAdvance(br_size_t count, void* f);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5,44 +5,43 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Global variables
|
||||
// DOSPICK has "$Id: stdlib.c 2.4 1996/12/06 21:18:39 sam Exp $" for this. Do we want to implement these?
|
||||
char rscid[48];
|
||||
|
||||
// Offset: 9
|
||||
// Size: 50
|
||||
int BrMemCmp(void *s1, void *s2, size_t n) {
|
||||
int BrMemCmp(void* s1, void* s2, size_t n) {
|
||||
return memcmp(s1, s2, n);
|
||||
}
|
||||
|
||||
// Offset: 68
|
||||
// Size: 50
|
||||
void* BrMemCpy(void *s1, void *s2, size_t n) {
|
||||
void* BrMemCpy(void* s1, void* s2, size_t n) {
|
||||
memcpy(s1, s2, n);
|
||||
}
|
||||
|
||||
// Offset: 127
|
||||
// Size: 50
|
||||
void* BrMemSet(void *s, int c, size_t n) {
|
||||
void* BrMemSet(void* s, int c, size_t n) {
|
||||
memset(s, c, n);
|
||||
}
|
||||
|
||||
// Offset: 186
|
||||
// Size: 47
|
||||
char* BrStrCat(char *s1, char *s2) {
|
||||
char* BrStrCat(char* s1, char* s2) {
|
||||
return strcat(s1, s2);
|
||||
}
|
||||
|
||||
// Offset: 242
|
||||
// Size: 47
|
||||
int BrStrCmp(char *s1, char *s2) {
|
||||
int BrStrCmp(char* s1, char* s2) {
|
||||
return strcmp(s1, s2);
|
||||
}
|
||||
|
||||
// Offset: 299
|
||||
// Size: 47
|
||||
int BrStrICmp(char *s1, char *s2) {
|
||||
int BrStrICmp(char* s1, char* s2) {
|
||||
// Windows is stricmp, while posix is strcasecmp
|
||||
#ifdef _WIN32
|
||||
return stricmp(s1, s2);
|
||||
|
@ -53,25 +52,25 @@ int BrStrICmp(char *s1, char *s2) {
|
|||
|
||||
// Offset: 355
|
||||
// Size: 47
|
||||
char* BrStrCpy(char *s1, const char *s2) {
|
||||
char* BrStrCpy(char* s1, const char* s2) {
|
||||
return strcpy(s1, s2);
|
||||
}
|
||||
|
||||
// Offset: 411
|
||||
// Size: 44
|
||||
br_size_t BrStrLen(char *s) {
|
||||
br_size_t BrStrLen(char* s) {
|
||||
return strlen(s);
|
||||
}
|
||||
|
||||
// Offset: 465
|
||||
// Size: 50
|
||||
int BrStrNCmp(char *s1, char *s2, size_t n) {
|
||||
int BrStrNCmp(char* s1, char* s2, size_t n) {
|
||||
return strncmp(s1, s2, n);
|
||||
}
|
||||
|
||||
// Offset: 526
|
||||
// Size: 50
|
||||
int BrStrNICmp(char *s1, char *s2, size_t n) {
|
||||
int BrStrNICmp(char* s1, char* s2, size_t n) {
|
||||
// Windows is strnicmp, while posix is strncasecmp
|
||||
#ifdef _WIN32
|
||||
return strnicmp(s1, s2, n);
|
||||
|
@ -82,13 +81,13 @@ int BrStrNICmp(char *s1, char *s2, size_t n) {
|
|||
|
||||
// Offset: 586
|
||||
// Size: 50
|
||||
char* BrStrNCpy(char *s1, char *s2, size_t n) {
|
||||
char* BrStrNCpy(char* s1, char* s2, size_t n) {
|
||||
return strncpy(s1, s2, n);
|
||||
}
|
||||
|
||||
// Offset: 646
|
||||
// Size: 49
|
||||
char* BrStrRChr(char *s1, char c) {
|
||||
char* BrStrRChr(char* s1, char c) {
|
||||
return strrchr(s1, c);
|
||||
}
|
||||
|
||||
|
@ -100,31 +99,31 @@ void BrAbort(void) {
|
|||
|
||||
// Offset: 747
|
||||
// Size: 44
|
||||
char* BrGetEnv(char *name) {
|
||||
char* BrGetEnv(char* name) {
|
||||
return getenv(name);
|
||||
}
|
||||
|
||||
// Offset: 800
|
||||
// Size: 58
|
||||
float BrStrToF(char *nptr, char **endptr) {
|
||||
float BrStrToF(char* nptr, char** endptr) {
|
||||
return strtof(nptr, endptr);
|
||||
}
|
||||
|
||||
// Offset: 867
|
||||
// Size: 67
|
||||
double BrStrToD(char *nptr, char **endptr) {
|
||||
double BrStrToD(char* nptr, char** endptr) {
|
||||
return strtod(nptr, endptr);
|
||||
}
|
||||
|
||||
// Offset: 943
|
||||
// Size: 50
|
||||
long BrStrToL(char *nptr, char **endptr, int base) {
|
||||
long BrStrToL(char* nptr, char** endptr, int base) {
|
||||
return strtol(nptr, endptr, base);
|
||||
}
|
||||
|
||||
// Offset: 1003
|
||||
// Size: 50
|
||||
unsigned long BrStrToUL(char *nptr, char **endptr, int base) {
|
||||
unsigned long BrStrToUL(char* nptr, char** endptr, int base) {
|
||||
return strtoul(nptr, endptr, base);
|
||||
}
|
||||
|
||||
|
@ -154,13 +153,13 @@ br_boolean BrIsPrint(int c) {
|
|||
|
||||
// Offset: 1340
|
||||
// Size: 50
|
||||
br_int_32 BrVSprintf(char *buf, const char *fmt, va_list args) {
|
||||
br_int_32 BrVSprintf(char* buf, const char* fmt, va_list args) {
|
||||
return vsprintf(buf, fmt, args);
|
||||
}
|
||||
|
||||
// Offset: 1402
|
||||
// Size: 101
|
||||
br_int_32 BrVSprintfN(char *buf, br_size_t buf_size, const char *fmt, va_list args) {
|
||||
br_int_32 BrVSprintfN(char* buf, br_size_t buf_size, const char* fmt, va_list args) {
|
||||
// Most C libs have vsnprintf these days that can replace this.
|
||||
unsigned int n;
|
||||
char tmp[512];
|
||||
|
@ -177,7 +176,6 @@ br_int_32 BrVSprintfN(char *buf, br_size_t buf_size, const char *fmt, va_list ar
|
|||
|
||||
// Offset: 1513
|
||||
// Size: 50
|
||||
br_int_32 BrVSScanf(char *buf, const char *fmt, va_list args) {
|
||||
br_int_32 BrVSScanf(char* buf, const char* fmt, va_list args) {
|
||||
return vsscanf(buf, fmt, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,13 +3,16 @@
|
|||
|
||||
#include "br_types.h"
|
||||
|
||||
extern br_allocator BrStdlibAllocator;
|
||||
extern br_allocator* _BrDefaultAllocator;
|
||||
|
||||
// Offset: 17
|
||||
// Size: 80
|
||||
void* BrStdlibAllocate(br_size_t size, br_uint_8 type);
|
||||
|
||||
// Offset: 110
|
||||
// Size: 38
|
||||
void BrStdlibFree(void *mem);
|
||||
void BrStdlibFree(void* mem);
|
||||
|
||||
// Offset: 164
|
||||
// Size: 40
|
||||
|
|
|
@ -1,13 +1,72 @@
|
|||
#include "dbsetup.h"
|
||||
|
||||
br_resource_class resourceClasses[14];
|
||||
#include "CORE/FW/brbegin.h"
|
||||
#include "CORE/FW/register.h"
|
||||
#include "CORE/FW/resource.h"
|
||||
#include "CORE/FW/resreg.h"
|
||||
#include "CORE/STD/brstdlib.h"
|
||||
#include "CORE/V1DB/def_mat.h"
|
||||
#include "CORE/V1DB/def_mdl.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
br_resource_class v1db_resourceClasses[14] = {
|
||||
{ 0u, "VERTICES", BR_MEMORY_VERTICES, NULL, 0u },
|
||||
{ 0u, "FACES", BR_MEMORY_FACES, NULL, 0u },
|
||||
{ 0u, "MODEL", BR_MEMORY_MODEL, NULL, 0u },
|
||||
{ 0u, "MATERIAL", BR_MEMORY_MATERIAL, NULL, 0u },
|
||||
{ 0u, "MATERIAL_INDEX", BR_MEMORY_MATERIAL_INDEX, NULL, 0u },
|
||||
{ 0u, "ACTOR", BR_MEMORY_ACTOR, NULL, 0u },
|
||||
{ 0u, "LIGHT", BR_MEMORY_LIGHT, NULL, 0u },
|
||||
{ 0u, "CAMERA", BR_MEMORY_CAMERA, NULL, 0u },
|
||||
{ 0u, "BOUNDS", BR_MEMORY_BOUNDS, NULL, 0u },
|
||||
{ 0u, "CLIP_PLANE", BR_MEMORY_CLIP_PLANE, NULL, 0u },
|
||||
{ 0u, "TRANSFORM", BR_MEMORY_TRANSFORM, NULL, 0u },
|
||||
{ 0u, "ENABLED_ACTORS", BR_MEMORY_ENABLED_ACTORS, NULL, 0u },
|
||||
{ 0u, "PREPARED_MODEL", BR_MEMORY_PREPARED_MODEL, NULL, 32u },
|
||||
{ 0u, "ORDER_TABLE", BR_MEMORY_ORDER_TABLE, NULL, 32u }
|
||||
};
|
||||
|
||||
br_v1db_state v1db;
|
||||
|
||||
// Offset: 12
|
||||
// Size: 345
|
||||
br_error BrV1dbBegin() {
|
||||
char *devstr;
|
||||
char* devstr;
|
||||
br_size_t s;
|
||||
int i;
|
||||
|
||||
if (v1db.active) {
|
||||
return 4103;
|
||||
}
|
||||
|
||||
printf("BrV1dbBegin\n");
|
||||
|
||||
BrMemSet(&v1db, 0, sizeof(br_v1db_state));
|
||||
v1db.active = 1;
|
||||
BrRegistryNew(&v1db.reg_models);
|
||||
BrRegistryNew(&v1db.reg_materials);
|
||||
BrRegistryNew(&v1db.reg_textures);
|
||||
BrRegistryNew(&v1db.reg_tables);
|
||||
v1db.res = BrResAllocate(NULL, 0, BR_MEMORY_ANCHOR);
|
||||
|
||||
for (i = 0; i < 14; i++) {
|
||||
BrResClassAdd(&v1db_resourceClasses[i]);
|
||||
}
|
||||
|
||||
v1db.default_model = (br_model*)BrResAllocate(v1db.res, sizeof(br_model), BR_MEMORY_MODEL);
|
||||
memcpy(v1db.default_model, &_BrDefaultModel, sizeof(br_model));
|
||||
v1db.default_material = SetupDefaultMaterial();
|
||||
v1db.enabled_lights.type = 2;
|
||||
v1db.enabled_clip_planes.name = "clip plane";
|
||||
v1db.enabled_clip_planes.type = 7;
|
||||
v1db.enabled_lights.max = 16;
|
||||
v1db.enabled_lights.name = "light";
|
||||
v1db.enabled_clip_planes.max = 6;
|
||||
v1db.enabled_horizon_planes.max = 6;
|
||||
v1db.enabled_horizon_planes.name = "horizon plane";
|
||||
v1db.enabled_horizon_planes.type = 8;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Offset: 367
|
||||
|
@ -17,48 +76,48 @@ br_error BrV1dbEnd() {
|
|||
|
||||
// Offset: 482
|
||||
// Size: 89
|
||||
br_uint_32 updateTable(br_pixelmap *item, void *arg) {
|
||||
br_uint_32 updateTable(br_pixelmap* item, void* arg) {
|
||||
}
|
||||
|
||||
// Offset: 581
|
||||
// Size: 89
|
||||
br_uint_32 updateMap(br_pixelmap *item, void *arg) {
|
||||
br_uint_32 updateMap(br_pixelmap* item, void* arg) {
|
||||
}
|
||||
|
||||
// Offset: 685
|
||||
// Size: 89
|
||||
br_uint_32 updateMaterial(br_material *item, void *arg) {
|
||||
br_uint_32 updateMaterial(br_material* item, void* arg) {
|
||||
}
|
||||
|
||||
// Offset: 786
|
||||
// Size: 89
|
||||
br_uint_32 updateModel(br_model *item, void *arg) {
|
||||
br_uint_32 updateModel(br_model* item, void* arg) {
|
||||
}
|
||||
|
||||
// Offset: 886
|
||||
// Size: 79
|
||||
br_uint_32 clearTable(br_pixelmap *item, void *arg) {
|
||||
br_uint_32 clearTable(br_pixelmap* item, void* arg) {
|
||||
}
|
||||
|
||||
// Offset: 974
|
||||
// Size: 79
|
||||
br_uint_32 clearMap(br_pixelmap *item, void *arg) {
|
||||
br_uint_32 clearMap(br_pixelmap* item, void* arg) {
|
||||
}
|
||||
|
||||
// Offset: 1067
|
||||
// Size: 79
|
||||
br_uint_32 clearMaterial(br_material *item, void *arg) {
|
||||
br_uint_32 clearMaterial(br_material* item, void* arg) {
|
||||
}
|
||||
|
||||
// Offset: 1157
|
||||
// Size: 79
|
||||
br_uint_32 clearModel(br_model *item, void *arg) {
|
||||
br_uint_32 clearModel(br_model* item, void* arg) {
|
||||
}
|
||||
|
||||
// Offset: 1256
|
||||
// Size: 462
|
||||
br_error BrV1dbRendererBegin(br_device_pixelmap *destination, br_renderer *renderer) {
|
||||
br_renderer_facility *renderer_facility;
|
||||
br_error BrV1dbRendererBegin(br_device_pixelmap* destination, br_renderer* renderer) {
|
||||
br_renderer_facility* renderer_facility;
|
||||
br_error r;
|
||||
br_token_value tv[2];
|
||||
}
|
||||
|
@ -80,7 +139,7 @@ void BrZbBegin(br_uint_8 colour_type, br_uint_8 depth_type) {
|
|||
|
||||
// Offset: 2133
|
||||
// Size: 141
|
||||
void BrZsBegin(br_uint_8 colour_type, void *primitive, br_uint_32 size) {
|
||||
void BrZsBegin(br_uint_8 colour_type, void* primitive, br_uint_32 size) {
|
||||
}
|
||||
|
||||
// Offset: 2282
|
||||
|
@ -96,10 +155,11 @@ void BrZsEnd() {
|
|||
// Offset: 2445
|
||||
// Size: 40
|
||||
void BrV1dbBeginWrapper_Float() {
|
||||
BrBegin();
|
||||
BrV1dbBegin();
|
||||
}
|
||||
|
||||
// Offset: 2502
|
||||
// Size: 40
|
||||
void BrV1dbEndWrapper() {
|
||||
}
|
||||
|
||||
|
|
|
@ -3,4 +3,6 @@
|
|||
|
||||
#include "br_types.h"
|
||||
|
||||
extern br_model _BrDefaultModel;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -10,7 +10,7 @@ DEPS := $(OBJS:.o=.d)
|
|||
INC_DIRS := $(shell find $(SRC_DIR) -type d)
|
||||
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
|
||||
|
||||
CFLAGS ?= $(INC_FLAGS) -Wno-return-type -Wno-missing-declarations -Werror=implicit-function-declaration
|
||||
CFLAGS ?= $(INC_FLAGS) -g -Wno-return-type -Wno-missing-declarations -Werror=implicit-function-declaration
|
||||
|
||||
.PHONY: clean build
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,9 @@
|
|||
#include "drmem.h"
|
||||
#include "CORE/FW/resreg.h"
|
||||
#include "errors.h"
|
||||
|
||||
br_resource_class gStainless_classes[118];
|
||||
char *gMem_names[247];
|
||||
char* gMem_names[247];
|
||||
int gNon_fatal_allocation_errors;
|
||||
br_allocator gAllocator;
|
||||
|
||||
|
@ -23,7 +25,7 @@ int AllocationErrorsAreFatal() {
|
|||
// Offset: 156
|
||||
// Size: 34
|
||||
void MAMSInitMem() {
|
||||
FILE *f;
|
||||
FILE* f;
|
||||
tPath_name the_path;
|
||||
}
|
||||
|
||||
|
@ -31,20 +33,20 @@ void MAMSInitMem() {
|
|||
// Size: 38
|
||||
// EAX: pFlags
|
||||
// EDX: pTitle
|
||||
void PrintMemoryDump(int pFlags, char *pTitle) {
|
||||
void PrintMemoryDump(int pFlags, char* pTitle) {
|
||||
}
|
||||
|
||||
// Offset: 232
|
||||
// Size: 169
|
||||
void* DRStdlibAllocate(br_size_t size, br_uint_8 type) {
|
||||
void *p;
|
||||
void* p;
|
||||
int i;
|
||||
char s[256];
|
||||
}
|
||||
|
||||
// Offset: 404
|
||||
// Size: 38
|
||||
void DRStdlibFree(void *mem) {
|
||||
void DRStdlibFree(void* mem) {
|
||||
int i;
|
||||
}
|
||||
|
||||
|
@ -66,22 +68,29 @@ void InstallDRMemCalls() {
|
|||
// Offset: 572
|
||||
// Size: 59
|
||||
// EAX: pPtr
|
||||
void MAMSUnlock(void **pPtr) {
|
||||
void MAMSUnlock(void** pPtr) {
|
||||
}
|
||||
|
||||
// Offset: 632
|
||||
// Size: 37
|
||||
// EAX: pPtr
|
||||
void MAMSLock(void **pPtr) {
|
||||
void MAMSLock(void** pPtr) {
|
||||
}
|
||||
|
||||
// Offset: 672
|
||||
// Size: 124
|
||||
void CreateStainlessClasses() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 118; i++) {
|
||||
gStainless_classes[i + 129].res_class = i;
|
||||
if (!BrResClassAdd(&gStainless_classes[i + 129])) {
|
||||
FatalError(94);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Offset: 796
|
||||
// Size: 34
|
||||
void CheckMemory() {
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
#include "graphics.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
int gArrows[2][4][60];
|
||||
int gMap_colours[4];
|
||||
br_vector3 gShadow_points[8];
|
||||
tConcussion gConcussion;
|
||||
tClip_details gShadow_clip_planes[8];
|
||||
br_matrix34 gSheer_mat;
|
||||
br_actor *gLollipops[100];
|
||||
br_actor* gLollipops[100];
|
||||
tWobble_spec gWobble_array[5];
|
||||
br_matrix34 gIdentity34;
|
||||
tSaved_table gSaved_shade_tables[100];
|
||||
int *gCursor_giblet_sequences[4];
|
||||
int* gCursor_giblet_sequences[4];
|
||||
int gCursor_y_offsets[8];
|
||||
int gCursor_x_offsets[8];
|
||||
tCursor_giblet gCursor_giblets[45];
|
||||
|
@ -18,11 +20,11 @@ int gCursor_gib_x_offsets[8];
|
|||
int gCursor_gib_y_offsets[8];
|
||||
tTransient_bm gTransient_bitmaps[50];
|
||||
float gCosine_array[64];
|
||||
br_pixelmap *gCursors[8];
|
||||
br_pixelmap *gCursor_giblet_images[18];
|
||||
br_pixelmap* gCursors[8];
|
||||
br_pixelmap* gCursor_giblet_images[18];
|
||||
br_scalar gShadow_hither_min_move;
|
||||
br_pixelmap *gEval_1;
|
||||
br_pixelmap *gEval_2;
|
||||
br_pixelmap* gEval_1;
|
||||
br_pixelmap* gEval_2;
|
||||
br_vector3 gShadow_light_z;
|
||||
br_vector3 gShadow_light_x;
|
||||
int gShadow_dim_amount;
|
||||
|
@ -32,36 +34,36 @@ br_vector3 gShadow_light_ray;
|
|||
br_scalar gShadow_hither_z_move;
|
||||
int gFancy_shadow;
|
||||
tShadow_level gShadow_level;
|
||||
br_model *gShadow_model;
|
||||
br_actor *gShadow_actor;
|
||||
br_model* gShadow_model;
|
||||
br_actor* gShadow_actor;
|
||||
int gShadow_clip_plane_count;
|
||||
br_pixelmap *gPalette_conversion_table;
|
||||
br_material *gShadow_material;
|
||||
br_pixelmap* gPalette_conversion_table;
|
||||
br_material* gShadow_material;
|
||||
int gSaved_table_count;
|
||||
int gCursor_giblet_sequence3[5];
|
||||
int gCursor_giblet_sequence2[5];
|
||||
char *gFont_names[21];
|
||||
char* gFont_names[21];
|
||||
int gCurrent_cursor_index;
|
||||
int gCursor_giblet_sequence1[5];
|
||||
int gCursor_giblet_sequence0[7];
|
||||
int gPalette_index;
|
||||
int gCursor_transient_index;
|
||||
char *gScratch_pixels;
|
||||
br_pixelmap *gScratch_palette;
|
||||
char* gScratch_pixels;
|
||||
br_pixelmap* gScratch_palette;
|
||||
int gPalette_munged;
|
||||
int gLast_palette_change;
|
||||
int gColourValues[1];
|
||||
br_pixelmap *gOrig_render_palette;
|
||||
br_pixelmap* gOrig_render_palette;
|
||||
int gNext_transient;
|
||||
br_pixelmap *gCurrent_palette;
|
||||
br_pixelmap *gRender_palette;
|
||||
br_pixelmap *gCurrent_splash;
|
||||
br_pixelmap *gCurrent_conversion_table;
|
||||
br_pixelmap* gCurrent_palette;
|
||||
br_pixelmap* gRender_palette;
|
||||
br_pixelmap* gCurrent_splash;
|
||||
br_pixelmap* gCurrent_conversion_table;
|
||||
float gCamera_to_horiz_angle;
|
||||
int gColours[9];
|
||||
br_pixelmap *gFlic_palette;
|
||||
br_pixelmap* gFlic_palette;
|
||||
tDR_font gFonts[21];
|
||||
char *gCurrent_palette_pixels;
|
||||
char* gCurrent_palette_pixels;
|
||||
int gAR_fudge_headups;
|
||||
float gMap_render_x;
|
||||
float gMap_render_y;
|
||||
|
@ -106,15 +108,15 @@ void ResetLollipopQueue() {
|
|||
// Size: 124
|
||||
// EAX: pActor
|
||||
// EDX: pIndex
|
||||
int AddToLollipopQueue(br_actor *pActor, int pIndex) {
|
||||
int AddToLollipopQueue(br_actor* pActor, int pIndex) {
|
||||
}
|
||||
|
||||
// Offset: 256
|
||||
// Size: 237
|
||||
void RenderLollipops() {
|
||||
int must_relink;
|
||||
br_actor **the_actor;
|
||||
br_actor *old_parent;
|
||||
br_actor** the_actor;
|
||||
br_actor* old_parent;
|
||||
}
|
||||
|
||||
// Offset: 496
|
||||
|
@ -123,8 +125,8 @@ void RenderLollipops() {
|
|||
// EDX: pX1
|
||||
// EBX: pY1
|
||||
// ECX: pX2
|
||||
void DRDrawLine(br_pixelmap *pDestn, int pX1, int pY1, int pX2, int pY2, int pColour) {
|
||||
tU8 *d_ptr;
|
||||
void DRDrawLine(br_pixelmap* pDestn, int pX1, int pY1, int pX2, int pY2, int pColour) {
|
||||
tU8* d_ptr;
|
||||
tS32 y_delta;
|
||||
tS32 x_delta;
|
||||
tU32 current_y;
|
||||
|
@ -141,7 +143,7 @@ void DRDrawLine(br_pixelmap *pDestn, int pX1, int pY1, int pX2, int pY2, int pCo
|
|||
// EDX: pX
|
||||
// EBX: pY
|
||||
// ECX: pY_pitch
|
||||
void DrawDigitAt(br_pixelmap *gImage, int pX, int pY, int pY_pitch, int pValue) {
|
||||
void DrawDigitAt(br_pixelmap* gImage, int pX, int pY, int pY_pitch, int pValue) {
|
||||
}
|
||||
|
||||
// Offset: 696
|
||||
|
@ -150,7 +152,7 @@ void DrawDigitAt(br_pixelmap *gImage, int pX, int pY, int pY_pitch, int pValue)
|
|||
// EDX: pX
|
||||
// EBX: pY
|
||||
// ECX: pX_pitch
|
||||
void DrawNumberAt(br_pixelmap *gImage, int pX, int pY, int pX_pitch, int pY_pitch, int pValue, int pDigit_count, int pLeading_zeroes) {
|
||||
void DrawNumberAt(br_pixelmap* gImage, int pX, int pY, int pX_pitch, int pY_pitch, int pValue, int pDigit_count, int pLeading_zeroes) {
|
||||
int i;
|
||||
int the_value;
|
||||
}
|
||||
|
@ -158,7 +160,7 @@ void DrawNumberAt(br_pixelmap *gImage, int pX, int pY, int pX_pitch, int pY_pitc
|
|||
// Offset: 852
|
||||
// Size: 350
|
||||
// EAX: pPalette
|
||||
void BuildColourTable(br_pixelmap *pPalette) {
|
||||
void BuildColourTable(br_pixelmap* pPalette) {
|
||||
int i;
|
||||
int j;
|
||||
int nearest_index;
|
||||
|
@ -178,7 +180,7 @@ void ClearConcussion() {
|
|||
// Size: 137
|
||||
// EAX: pSource
|
||||
// EDX: pCount
|
||||
tS8* SkipLines(tS8 *pSource, int pCount) {
|
||||
tS8* SkipLines(tS8* pSource, int pCount) {
|
||||
int i;
|
||||
int j;
|
||||
int number_of_chunks;
|
||||
|
@ -190,9 +192,9 @@ tS8* SkipLines(tS8 *pSource, int pCount) {
|
|||
// EAX: pDst
|
||||
// EDX: pSrc
|
||||
// EBX: pN
|
||||
void CopyWords(char *pDst, char *pSrc, int pN) {
|
||||
tU16 *dst;
|
||||
tU16 *src;
|
||||
void CopyWords(char* pDst, char* pSrc, int pN) {
|
||||
tU16* dst;
|
||||
tU16* src;
|
||||
}
|
||||
|
||||
// Offset: 1516
|
||||
|
@ -201,7 +203,7 @@ void CopyWords(char *pDst, char *pSrc, int pN) {
|
|||
// EDX: pDest_x
|
||||
// EBX: pOffset_x
|
||||
// ECX: pDest_y
|
||||
void Copy8BitStripImageTo16Bit(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16 pOffset_x, br_int_16 pDest_y, br_int_16 pOffset_y, tS8 *pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_uint_16 pWidth, br_uint_16 pHeight) {
|
||||
void Copy8BitStripImageTo16Bit(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pOffset_x, br_int_16 pDest_y, br_int_16 pOffset_y, tS8* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_uint_16 pWidth, br_uint_16 pHeight) {
|
||||
int i;
|
||||
int j;
|
||||
int height;
|
||||
|
@ -211,8 +213,8 @@ void Copy8BitStripImageTo16Bit(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16
|
|||
int off_the_left;
|
||||
int destn_width;
|
||||
int chunk_length;
|
||||
char *destn_ptr;
|
||||
char *destn_ptr2;
|
||||
char* destn_ptr;
|
||||
char* destn_ptr2;
|
||||
}
|
||||
|
||||
// Offset: 2124
|
||||
|
@ -221,7 +223,7 @@ void Copy8BitStripImageTo16Bit(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16
|
|||
// EDX: pDest_x
|
||||
// EBX: pOffset_x
|
||||
// ECX: pDest_y
|
||||
void CopyStripImage(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16 pOffset_x, br_int_16 pDest_y, br_int_16 pOffset_y, tS8 *pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_uint_16 pWidth, br_uint_16 pHeight) {
|
||||
void CopyStripImage(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pOffset_x, br_int_16 pDest_y, br_int_16 pOffset_y, tS8* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_uint_16 pWidth, br_uint_16 pHeight) {
|
||||
int i;
|
||||
int j;
|
||||
int height;
|
||||
|
@ -231,8 +233,8 @@ void CopyStripImage(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16 pOffset_x,
|
|||
int off_the_left;
|
||||
int destn_width;
|
||||
int chunk_length;
|
||||
char *destn_ptr;
|
||||
char *destn_ptr2;
|
||||
char* destn_ptr;
|
||||
char* destn_ptr2;
|
||||
}
|
||||
|
||||
// Offset: 2776
|
||||
|
@ -269,27 +271,27 @@ void ScreenLarger() {
|
|||
// EAX: pPalette
|
||||
// EDX: pFirst_colour
|
||||
// EBX: pCount
|
||||
void DRSetPaletteEntries(br_pixelmap *pPalette, int pFirst_colour, int pCount) {
|
||||
void DRSetPaletteEntries(br_pixelmap* pPalette, int pFirst_colour, int pCount) {
|
||||
}
|
||||
|
||||
// Offset: 4144
|
||||
// Size: 128
|
||||
// EAX: pThe_palette
|
||||
// EDX: pSet_current_palette
|
||||
void DRSetPalette3(br_pixelmap *pThe_palette, int pSet_current_palette) {
|
||||
void DRSetPalette3(br_pixelmap* pThe_palette, int pSet_current_palette) {
|
||||
}
|
||||
|
||||
// Offset: 4272
|
||||
// Size: 140
|
||||
// EAX: pThe_palette
|
||||
// EDX: pSet_current_palette
|
||||
void DRSetPalette2(br_pixelmap *pThe_palette, int pSet_current_palette) {
|
||||
void DRSetPalette2(br_pixelmap* pThe_palette, int pSet_current_palette) {
|
||||
}
|
||||
|
||||
// Offset: 4412
|
||||
// Size: 50
|
||||
// EAX: pThe_palette
|
||||
void DRSetPalette(br_pixelmap *pThe_palette) {
|
||||
void DRSetPalette(br_pixelmap* pThe_palette) {
|
||||
}
|
||||
|
||||
// Offset: 4464
|
||||
|
@ -301,8 +303,8 @@ void InitializePalettes() {
|
|||
// Offset: 4880
|
||||
// Size: 66
|
||||
// EAX: pPal_name
|
||||
void SwitchToPalette(char *pPal_name) {
|
||||
br_pixelmap *the_palette;
|
||||
void SwitchToPalette(char* pPal_name) {
|
||||
br_pixelmap* the_palette;
|
||||
}
|
||||
|
||||
// Offset: 4948
|
||||
|
@ -318,6 +320,15 @@ void ClearWobbles() {
|
|||
// Offset: 5128
|
||||
// Size: 108
|
||||
void InitWobbleStuff() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
gWobble_array[i].amplitude_x = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
gCosine_array[i] = cosf((double)i * 0.015625f * 3.141592653589793f * 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
// Offset: 5236
|
||||
|
@ -377,7 +388,7 @@ void SufferFromConcussion(float pSeriousness) {
|
|||
// EDX: pDepth_buffer
|
||||
// EBX: pCamera
|
||||
// ECX: pCamera_to_world
|
||||
void ProcessNonTrackActors(br_pixelmap *pRender_buffer, br_pixelmap *pDepth_buffer, br_actor *pCamera, br_matrix34 *pCamera_to_world, br_matrix34 *pOld_camera_matrix) {
|
||||
void ProcessNonTrackActors(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer, br_actor* pCamera, br_matrix34* pCamera_to_world, br_matrix34* pOld_camera_matrix) {
|
||||
}
|
||||
|
||||
// Offset: 7188
|
||||
|
@ -393,10 +404,10 @@ int OppositeColour(int pColour) {
|
|||
// EDX: pTime
|
||||
// EBX: pTrans
|
||||
// ECX: pPos
|
||||
void DrawMapBlip(tCar_spec *pCar, tU32 pTime, br_matrix34 *pTrans, br_vector3 *pPos, int pColour) {
|
||||
void DrawMapBlip(tCar_spec* pCar, tU32 pTime, br_matrix34* pTrans, br_vector3* pPos, int pColour) {
|
||||
br_vector3 map_pos;
|
||||
int offset;
|
||||
int *arrow_ptr;
|
||||
int* arrow_ptr;
|
||||
int point_count;
|
||||
int colours[2];
|
||||
int x;
|
||||
|
@ -423,7 +434,7 @@ void DrawMapBlip(tCar_spec *pCar, tU32 pTime, br_matrix34 *pTrans, br_vector3 *p
|
|||
// EAX: pTime
|
||||
// EDX: pPos
|
||||
// EBX: pColour
|
||||
void DrawMapSmallBlip(tU32 pTime, br_vector3 *pPos, int pColour) {
|
||||
void DrawMapSmallBlip(tU32 pTime, br_vector3* pPos, int pColour) {
|
||||
br_vector3 map_pos;
|
||||
int offset;
|
||||
tU32 time_diff;
|
||||
|
@ -435,13 +446,13 @@ void DrawMapSmallBlip(tU32 pTime, br_vector3 *pPos, int pColour) {
|
|||
// EDX: pCar
|
||||
// EBX: p1
|
||||
// ECX: p2
|
||||
void MungeClipPlane(br_vector3 *pLight, tCar_spec *pCar, br_vector3 *p1, br_vector3 *p2, br_scalar pY_offset) {
|
||||
void MungeClipPlane(br_vector3* pLight, tCar_spec* pCar, br_vector3* p1, br_vector3* p2, br_scalar pY_offset) {
|
||||
br_vector3 v1;
|
||||
br_vector3 v2;
|
||||
br_vector3 v3;
|
||||
br_vector3 v4;
|
||||
br_scalar length;
|
||||
br_actor *new_clip;
|
||||
br_actor* new_clip;
|
||||
}
|
||||
|
||||
// Offset: 10024
|
||||
|
@ -449,7 +460,7 @@ void MungeClipPlane(br_vector3 *pLight, tCar_spec *pCar, br_vector3 *p1, br_vect
|
|||
// EAX: pCar
|
||||
// EDX: pLight
|
||||
// EBX: pIndex_1
|
||||
void TryThisEdge(tCar_spec *pCar, br_vector3 *pLight, int pIndex_1, br_scalar pSign_1, int pIndex_2, br_scalar pSign_2, int pPoint_index_1, int pPoint_index_2, br_scalar pY_offset) {
|
||||
void TryThisEdge(tCar_spec* pCar, br_vector3* pLight, int pIndex_1, br_scalar pSign_1, int pIndex_2, br_scalar pSign_2, int pPoint_index_1, int pPoint_index_2, br_scalar pY_offset) {
|
||||
br_scalar dot_1;
|
||||
br_scalar dot_2;
|
||||
br_scalar mult;
|
||||
|
@ -458,7 +469,7 @@ void TryThisEdge(tCar_spec *pCar, br_vector3 *pLight, int pIndex_1, br_scalar pS
|
|||
// Offset: 10204
|
||||
// Size: 104
|
||||
// EAX: pPos
|
||||
br_scalar DistanceFromPlane(br_vector3 *pPos, br_scalar pA, br_scalar pB, br_scalar pC, br_scalar pD) {
|
||||
br_scalar DistanceFromPlane(br_vector3* pPos, br_scalar pA, br_scalar pB, br_scalar pC, br_scalar pD) {
|
||||
br_vector3 normal;
|
||||
}
|
||||
|
||||
|
@ -478,7 +489,7 @@ void EnableLights() {
|
|||
// EDX: pWorld
|
||||
// EBX: pTrack_spec
|
||||
// ECX: pCamera
|
||||
void ProcessShadow(tCar_spec *pCar, br_actor *pWorld, tTrack_spec *pTrack_spec, br_actor *pCamera, br_matrix34 *pCamera_to_world_transform, br_scalar pDistance_factor) {
|
||||
void ProcessShadow(tCar_spec* pCar, br_actor* pWorld, tTrack_spec* pTrack_spec, br_actor* pCamera, br_matrix34* pCamera_to_world_transform, br_scalar pDistance_factor) {
|
||||
int i;
|
||||
int j;
|
||||
int face_count;
|
||||
|
@ -498,10 +509,10 @@ void ProcessShadow(tCar_spec *pCar, br_actor *pWorld, tTrack_spec *pTrack_spec,
|
|||
br_vector3 normal;
|
||||
br_vector3 the_normal;
|
||||
br_vector3 pos_cam_space;
|
||||
br_vector3 *v0;
|
||||
br_vector3 *v1;
|
||||
br_vector3 *v2;
|
||||
br_vector4 *clip_normal;
|
||||
br_vector3* v0;
|
||||
br_vector3* v1;
|
||||
br_vector3* v2;
|
||||
br_vector4* clip_normal;
|
||||
br_scalar bounds_x_min;
|
||||
br_scalar bounds_x_max;
|
||||
br_scalar bounds_y_min;
|
||||
|
@ -522,13 +533,13 @@ void ProcessShadow(tCar_spec *pCar, br_actor *pWorld, tTrack_spec *pTrack_spec,
|
|||
br_scalar ray_length;
|
||||
tBounds kev_bounds;
|
||||
tFace_ref the_list[100];
|
||||
tFace_ref *face_ref;
|
||||
tFace_ref *list_ptr;
|
||||
br_renderbounds_cbfn *old_call_back;
|
||||
br_camera *camera_ptr;
|
||||
br_actor *oily_actor;
|
||||
br_model *model;
|
||||
br_material *material;
|
||||
tFace_ref* face_ref;
|
||||
tFace_ref* list_ptr;
|
||||
br_renderbounds_cbfn* old_call_back;
|
||||
br_camera* camera_ptr;
|
||||
br_actor* oily_actor;
|
||||
br_model* model;
|
||||
br_material* material;
|
||||
br_vertex verts[48];
|
||||
br_face faces[16];
|
||||
}
|
||||
|
@ -539,11 +550,11 @@ void ProcessShadow(tCar_spec *pCar, br_actor *pWorld, tTrack_spec *pTrack_spec,
|
|||
// EDX: pTrack_spec
|
||||
// EBX: pCamera
|
||||
// ECX: pCamera_to_world_transform
|
||||
void RenderShadows(br_actor *pWorld, tTrack_spec *pTrack_spec, br_actor *pCamera, br_matrix34 *pCamera_to_world_transform) {
|
||||
void RenderShadows(br_actor* pWorld, tTrack_spec* pTrack_spec, br_actor* pCamera, br_matrix34* pCamera_to_world_transform) {
|
||||
int i;
|
||||
int cat;
|
||||
int car_count;
|
||||
tCar_spec *the_car;
|
||||
tCar_spec* the_car;
|
||||
br_vector3 camera_to_car;
|
||||
br_scalar distance_factor;
|
||||
}
|
||||
|
@ -553,7 +564,7 @@ void RenderShadows(br_actor *pWorld, tTrack_spec *pTrack_spec, br_actor *pCamera
|
|||
// EAX: pIndex
|
||||
// EDX: pTime
|
||||
void FlashyMapCheckpoint(int pIndex, tU32 pTime) {
|
||||
tCheckpoint *cp;
|
||||
tCheckpoint* cp;
|
||||
static tU32 last_flash;
|
||||
static int flash_state;
|
||||
}
|
||||
|
@ -561,7 +572,7 @@ void FlashyMapCheckpoint(int pIndex, tU32 pTime) {
|
|||
// Offset: 15908
|
||||
// Size: 252
|
||||
// EAX: pPixelmap
|
||||
int ConditionallyFillWithSky(br_pixelmap *pPixelmap) {
|
||||
int ConditionallyFillWithSky(br_pixelmap* pPixelmap) {
|
||||
int bgnd_col;
|
||||
}
|
||||
|
||||
|
@ -583,14 +594,14 @@ void RenderAFrame(int pDepth_mask_on) {
|
|||
int map_timer_x;
|
||||
int map_timer_width;
|
||||
int ped_type;
|
||||
char *old_pixels;
|
||||
char* old_pixels;
|
||||
br_matrix34 old_camera_matrix;
|
||||
br_matrix34 old_mirror_cam_matrix;
|
||||
tU32 the_time;
|
||||
br_vector3 *car_pos;
|
||||
br_vector3* car_pos;
|
||||
br_vector3 pos;
|
||||
char the_text[256];
|
||||
tCar_spec *car;
|
||||
tCar_spec* car;
|
||||
}
|
||||
|
||||
// Offset: 19912
|
||||
|
@ -606,7 +617,7 @@ void RevertPalette() {
|
|||
// Offset: 20044
|
||||
// Size: 34
|
||||
void MungePalette() {
|
||||
tU8 *q;
|
||||
tU8* q;
|
||||
int i;
|
||||
float damage;
|
||||
float throb_start;
|
||||
|
@ -631,7 +642,7 @@ void ResetPalette() {
|
|||
// Size: 65
|
||||
// EAX: pPtr
|
||||
// EDX: pDarken_amount
|
||||
void Darken(tU8 *pPtr, unsigned int pDarken_amount) {
|
||||
void Darken(tU8* pPtr, unsigned int pDarken_amount) {
|
||||
unsigned int value;
|
||||
}
|
||||
|
||||
|
@ -640,8 +651,8 @@ void Darken(tU8 *pPtr, unsigned int pDarken_amount) {
|
|||
// EAX: pDegree
|
||||
void SetFadedPalette(int pDegree) {
|
||||
int j;
|
||||
br_pixelmap *the_palette;
|
||||
char *the_pixels;
|
||||
br_pixelmap* the_palette;
|
||||
char* the_pixels;
|
||||
}
|
||||
|
||||
// Offset: 20396
|
||||
|
@ -671,8 +682,8 @@ void EnsureRenderPalette() {
|
|||
// Offset: 20812
|
||||
// Size: 248
|
||||
// EAX: pPixmap_name
|
||||
void SplashScreenWith(char *pPixmap_name) {
|
||||
br_pixelmap *the_map;
|
||||
void SplashScreenWith(char* pPixmap_name) {
|
||||
br_pixelmap* the_map;
|
||||
}
|
||||
|
||||
// Offset: 21060
|
||||
|
@ -682,7 +693,7 @@ void EnsurePaletteUp() {
|
|||
|
||||
// Offset: 21108
|
||||
// Size: 103
|
||||
br_uint_32 AmbientificateMaterial(br_material *pMat, void *pArg) {
|
||||
br_uint_32 AmbientificateMaterial(br_material* pMat, void* pArg) {
|
||||
float a;
|
||||
}
|
||||
|
||||
|
@ -702,16 +713,16 @@ void InitAmbience() {
|
|||
// EDX: pDest_x
|
||||
// EBX: pDest_y
|
||||
// ECX: pSource
|
||||
void DRPixelmapRectangleMaskedCopy(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap *pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight) {
|
||||
void DRPixelmapRectangleMaskedCopy(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight) {
|
||||
int y_count;
|
||||
int x_count;
|
||||
int dest_row_wrap;
|
||||
int source_row_wrap;
|
||||
int x_delta;
|
||||
tU8 the_byte;
|
||||
tU8 *source_ptr;
|
||||
tU8 *dest_ptr;
|
||||
tU8 *conv_table;
|
||||
tU8* source_ptr;
|
||||
tU8* dest_ptr;
|
||||
tU8* conv_table;
|
||||
}
|
||||
|
||||
// Offset: 22120
|
||||
|
@ -719,7 +730,7 @@ void DRPixelmapRectangleMaskedCopy(br_pixelmap *pDest, br_int_16 pDest_x, br_int
|
|||
// EAX: pDest_x
|
||||
// EDX: pDest_y
|
||||
// EBX: pSource
|
||||
void DRMaskedStamp(br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap *pSource) {
|
||||
void DRMaskedStamp(br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource) {
|
||||
}
|
||||
|
||||
// Offset: 22208
|
||||
|
@ -728,16 +739,16 @@ void DRMaskedStamp(br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap *pSource) {
|
|||
// EDX: pDest_x
|
||||
// EBX: pDest_y
|
||||
// ECX: pSource
|
||||
void DRPixelmapRectangleOnscreenCopy(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap *pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight) {
|
||||
void DRPixelmapRectangleOnscreenCopy(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight) {
|
||||
int y_count;
|
||||
int x_count;
|
||||
int dest_row_wrap;
|
||||
int source_row_wrap;
|
||||
int x_delta;
|
||||
tU8 the_byte;
|
||||
tU8 *source_ptr;
|
||||
tU8 *dest_ptr;
|
||||
tU8 *conv_table;
|
||||
tU8* source_ptr;
|
||||
tU8* dest_ptr;
|
||||
tU8* conv_table;
|
||||
}
|
||||
|
||||
// Offset: 22540
|
||||
|
@ -746,7 +757,7 @@ void DRPixelmapRectangleOnscreenCopy(br_pixelmap *pDest, br_int_16 pDest_x, br_i
|
|||
// EDX: pDest_x
|
||||
// EBX: pDest_y
|
||||
// ECX: pSource
|
||||
void DRPixelmapRectangleShearedCopy(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap *pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight, tX1616 pShear) {
|
||||
void DRPixelmapRectangleShearedCopy(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight, tX1616 pShear) {
|
||||
int y_count;
|
||||
int x_count;
|
||||
int dest_row_wrap;
|
||||
|
@ -756,9 +767,9 @@ void DRPixelmapRectangleShearedCopy(br_pixelmap *pDest, br_int_16 pDest_x, br_in
|
|||
int current_shear_x;
|
||||
int shear_x_difference;
|
||||
tU8 the_byte;
|
||||
tU8 *source_ptr;
|
||||
tU8 *dest_ptr;
|
||||
tU8 *conv_table;
|
||||
tU8* source_ptr;
|
||||
tU8* dest_ptr;
|
||||
tU8* conv_table;
|
||||
tX1616 current_shear;
|
||||
}
|
||||
|
||||
|
@ -768,15 +779,15 @@ void DRPixelmapRectangleShearedCopy(br_pixelmap *pDest, br_int_16 pDest_x, br_in
|
|||
// EDX: pDest_x
|
||||
// EBX: pDest_y
|
||||
// ECX: pSource
|
||||
void DRPixelmapRectangleVScaledCopy(br_pixelmap *pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap *pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight) {
|
||||
void DRPixelmapRectangleVScaledCopy(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight) {
|
||||
int y_count;
|
||||
int x_count;
|
||||
int dest_row_wrap;
|
||||
int source_row_wrap;
|
||||
int x_delta;
|
||||
tU8 the_byte;
|
||||
tU8 *source_ptr;
|
||||
tU8 *dest_ptr;
|
||||
tU8* source_ptr;
|
||||
tU8* dest_ptr;
|
||||
tU32 source_y;
|
||||
tU32 source_y_delta;
|
||||
tU32 old_source_y;
|
||||
|
@ -826,8 +837,8 @@ void SaveTransient(int pIndex, int pX_coord, int pY_coord) {
|
|||
// Offset: 24592
|
||||
// Size: 214
|
||||
// EAX: pGib
|
||||
void DrawCursorGiblet(tCursor_giblet *pGib) {
|
||||
br_pixelmap *the_image;
|
||||
void DrawCursorGiblet(tCursor_giblet* pGib) {
|
||||
br_pixelmap* the_image;
|
||||
}
|
||||
|
||||
// Offset: 24808
|
||||
|
@ -837,7 +848,7 @@ void ProcessCursorGiblets(int pPeriod) {
|
|||
int i;
|
||||
int kill_the_giblet;
|
||||
tU32 time_now;
|
||||
tCursor_giblet *gib;
|
||||
tCursor_giblet* gib;
|
||||
}
|
||||
|
||||
// Offset: 25552
|
||||
|
@ -897,7 +908,7 @@ void LoadFont(int pFont_ID) {
|
|||
tPath_name the_path;
|
||||
int i;
|
||||
int number_of_chars;
|
||||
FILE *f;
|
||||
FILE* f;
|
||||
tU32 the_size;
|
||||
}
|
||||
|
||||
|
@ -918,7 +929,7 @@ void InitDRFonts() {
|
|||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
// ECX: pTop_clip
|
||||
void DrawDropImage(br_pixelmap *pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip, int pOffset) {
|
||||
void DrawDropImage(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip, int pOffset) {
|
||||
int y;
|
||||
int src_y;
|
||||
int src_height;
|
||||
|
@ -931,7 +942,7 @@ void DrawDropImage(br_pixelmap *pImage, int pLeft, int pTop, int pTop_clip, int
|
|||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
// ECX: pTop_clip
|
||||
void DropInImageFromTop(br_pixelmap *pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip) {
|
||||
void DropInImageFromTop(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip) {
|
||||
tS32 start_time;
|
||||
tS32 the_time;
|
||||
int drop_distance;
|
||||
|
@ -943,7 +954,7 @@ void DropInImageFromTop(br_pixelmap *pImage, int pLeft, int pTop, int pTop_clip,
|
|||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
// ECX: pTop_clip
|
||||
void DropOutImageThruBottom(br_pixelmap *pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip) {
|
||||
void DropOutImageThruBottom(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip) {
|
||||
tS32 start_time;
|
||||
tS32 the_time;
|
||||
int drop_distance;
|
||||
|
@ -955,7 +966,7 @@ void DropOutImageThruBottom(br_pixelmap *pImage, int pLeft, int pTop, int pTop_c
|
|||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
// ECX: pTop_clip
|
||||
void DropInImageFromBottom(br_pixelmap *pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip) {
|
||||
void DropInImageFromBottom(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip) {
|
||||
tS32 start_time;
|
||||
tS32 the_time;
|
||||
int drop_distance;
|
||||
|
@ -967,7 +978,7 @@ void DropInImageFromBottom(br_pixelmap *pImage, int pLeft, int pTop, int pTop_cl
|
|||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
// ECX: pTop_clip
|
||||
void DropOutImageThruTop(br_pixelmap *pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip) {
|
||||
void DropOutImageThruTop(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip) {
|
||||
tS32 start_time;
|
||||
tS32 the_time;
|
||||
int drop_distance;
|
||||
|
@ -979,7 +990,7 @@ void DropOutImageThruTop(br_pixelmap *pImage, int pLeft, int pTop, int pTop_clip
|
|||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
// ECX: pPercentage
|
||||
void DrawTellyLine(br_pixelmap *pImage, int pLeft, int pTop, int pPercentage) {
|
||||
void DrawTellyLine(br_pixelmap* pImage, int pLeft, int pTop, int pPercentage) {
|
||||
int the_width;
|
||||
int the_height;
|
||||
}
|
||||
|
@ -990,7 +1001,7 @@ void DrawTellyLine(br_pixelmap *pImage, int pLeft, int pTop, int pPercentage) {
|
|||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
// ECX: pPercentage
|
||||
void DrawTellyImage(br_pixelmap *pImage, int pLeft, int pTop, int pPercentage) {
|
||||
void DrawTellyImage(br_pixelmap* pImage, int pLeft, int pTop, int pPercentage) {
|
||||
int the_height;
|
||||
}
|
||||
|
||||
|
@ -999,7 +1010,7 @@ void DrawTellyImage(br_pixelmap *pImage, int pLeft, int pTop, int pPercentage) {
|
|||
// EAX: pImage
|
||||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
void TellyInImage(br_pixelmap *pImage, int pLeft, int pTop) {
|
||||
void TellyInImage(br_pixelmap* pImage, int pLeft, int pTop) {
|
||||
tS32 start_time;
|
||||
tS32 the_time;
|
||||
}
|
||||
|
@ -1009,7 +1020,7 @@ void TellyInImage(br_pixelmap *pImage, int pLeft, int pTop) {
|
|||
// EAX: pImage
|
||||
// EDX: pLeft
|
||||
// EBX: pTop
|
||||
void TellyOutImage(br_pixelmap *pImage, int pLeft, int pTop) {
|
||||
void TellyOutImage(br_pixelmap* pImage, int pLeft, int pTop) {
|
||||
tS32 start_time;
|
||||
tS32 the_time;
|
||||
int drop_distance;
|
||||
|
@ -1040,7 +1051,7 @@ void InitShadow() {
|
|||
|
||||
// Offset: 31320
|
||||
// Size: 140
|
||||
br_uint_32 SaveShadeTable(br_pixelmap *pTable, void *pArg) {
|
||||
br_uint_32 SaveShadeTable(br_pixelmap* pTable, void* pArg) {
|
||||
}
|
||||
|
||||
// Offset: 31460
|
||||
|
@ -1074,11 +1085,11 @@ int SwitchToLoresMode() {
|
|||
// EDX: pSource
|
||||
// EBX: pSource_width
|
||||
// ECX: pSource_height
|
||||
void DRPixelmapDoubledCopy(br_pixelmap *pDestn, br_pixelmap *pSource, int pSource_width, int pSource_height, int pX_offset, int pY_offset) {
|
||||
tU16 *sptr;
|
||||
void DRPixelmapDoubledCopy(br_pixelmap* pDestn, br_pixelmap* pSource, int pSource_width, int pSource_height, int pX_offset, int pY_offset) {
|
||||
tU16* sptr;
|
||||
tU16 pixels;
|
||||
tU8 *dptr;
|
||||
tU8 *dptr2;
|
||||
tU8* dptr;
|
||||
tU8* dptr2;
|
||||
tU8 pixel_1;
|
||||
tU8 pixel_2;
|
||||
int i;
|
||||
|
@ -1087,4 +1098,3 @@ void DRPixelmapDoubledCopy(br_pixelmap *pDestn, br_pixelmap *pSource, int pSourc
|
|||
int src_row_skip;
|
||||
int width_over_2;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,53 @@
|
|||
#include "framework/unity.h"
|
||||
|
||||
#include "CORE/FW/brlists.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void test_brlists_BrSimpleList() {
|
||||
br_simple_list* list = calloc(1, sizeof(br_simple_list));
|
||||
br_simple_node* one = calloc(1, sizeof(br_simple_node));
|
||||
br_simple_node* two = calloc(1, sizeof(br_simple_node));
|
||||
br_simple_node* three = calloc(1, sizeof(br_simple_node));
|
||||
|
||||
BrSimpleNewList(list);
|
||||
TEST_ASSERT_NULL(list->head);
|
||||
|
||||
BrSimpleAddHead(list, one);
|
||||
// expected 1->null
|
||||
TEST_ASSERT_EQUAL_PTR(one, list->head);
|
||||
TEST_ASSERT_NULL(one->next);
|
||||
TEST_ASSERT_EQUAL_PTR(list, one->prev);
|
||||
|
||||
BrSimpleAddHead(list, two);
|
||||
// expected 2->1->null
|
||||
TEST_ASSERT_EQUAL_PTR(two, list->head);
|
||||
TEST_ASSERT_EQUAL_PTR(one, two->next);
|
||||
TEST_ASSERT_EQUAL_PTR(list, two->prev);
|
||||
|
||||
TEST_ASSERT_EQUAL_PTR(two, one->prev);
|
||||
TEST_ASSERT_NULL(one->next);
|
||||
|
||||
BrSimpleAddHead(list, three);
|
||||
// expected 3->2->1->null
|
||||
TEST_ASSERT_EQUAL_PTR(two, one->prev);
|
||||
|
||||
TEST_ASSERT_EQUAL_PTR(three, list->head);
|
||||
TEST_ASSERT_EQUAL_PTR(two, three->next);
|
||||
TEST_ASSERT_EQUAL_PTR(list, three->prev);
|
||||
|
||||
TEST_ASSERT_EQUAL_PTR(three, two->prev);
|
||||
TEST_ASSERT_EQUAL_PTR(one, two->next);
|
||||
|
||||
TEST_ASSERT_EQUAL_PTR(two, one->prev);
|
||||
TEST_ASSERT_NULL(one->next);
|
||||
|
||||
free(list);
|
||||
free(one);
|
||||
free(two);
|
||||
free(three);
|
||||
}
|
||||
|
||||
void test_brlists_suite() {
|
||||
RUN_TEST(test_brlists_BrSimpleList);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
#include "framework/unity.h"
|
||||
|
||||
#include "CORE/FW/fwsetup.h"
|
||||
#include <string.h>
|
||||
|
||||
void test_fwsetup_BrFwBegin() {
|
||||
TEST_ASSERT_TRUE(fw.active);
|
||||
}
|
||||
|
||||
void test_fwsetup_suite() {
|
||||
RUN_TEST(test_fwsetup_BrFwBegin);
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
#include "framework/unity.h"
|
||||
|
||||
#include "CORE/FW/resource.h"
|
||||
#include <string.h>
|
||||
|
||||
void test_resource_BrResAllocate() {
|
||||
void* parent;
|
||||
void* child;
|
||||
resource_header* parent_header;
|
||||
resource_header* child_header;
|
||||
|
||||
parent = BrResAllocate(NULL, 0, BR_MEMORY_ANCHOR);
|
||||
TEST_ASSERT_NOT_NULL(parent);
|
||||
parent_header = (resource_header*)(((char*)parent) - sizeof(resource_header) - 4);
|
||||
TEST_ASSERT_EQUAL_UINT32(0xDEADBEEF, parent_header->magic_num);
|
||||
TEST_ASSERT_NULL(parent_header->children.head);
|
||||
TEST_ASSERT_EQUAL_CHAR(BR_MEMORY_ANCHOR, parent_header->class);
|
||||
TEST_ASSERT_EQUAL_PTR(parent_header, parent_header->magic_ptr);
|
||||
|
||||
child = BrResAllocate(parent, 0, BR_MEMORY_ANCHOR);
|
||||
child_header = (resource_header*)(((char*)child) - sizeof(resource_header) - 4);
|
||||
TEST_ASSERT_EQUAL_PTR(&child_header->node, parent_header->children.head);
|
||||
TEST_ASSERT_NULL(parent_header->children.head->next);
|
||||
// ? TEST_ASSERT_NULL(parent_header->children.head->prev);
|
||||
}
|
||||
|
||||
void test_resource_suite() {
|
||||
RUN_TEST(test_resource_BrResAllocate);
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
#include "framework/unity.h"
|
||||
|
||||
#include "CORE/FW/resource.h"
|
||||
#include <string.h>
|
22
test/main.c
22
test/main.c
|
@ -1,11 +1,15 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "framework/unity.h"
|
||||
|
||||
#include "CORE/V1DB/dbsetup.h"
|
||||
|
||||
#include "common/globvars.h"
|
||||
|
||||
#define debug(format_, ...) fprintf(stderr, format_, __VA_ARGS__)
|
||||
|
||||
extern void test_utility_suite();
|
||||
extern void test_loading_suite();
|
||||
extern void test_controls_suite();
|
||||
|
@ -13,18 +17,30 @@ extern void test_input_suite();
|
|||
extern void test_errors_suite();
|
||||
extern void test_dossys_suite();
|
||||
|
||||
extern void test_brlists_suite();
|
||||
extern void test_fwsetup_suite();
|
||||
extern void test_resource_suite();
|
||||
|
||||
void setUp(void) {
|
||||
strcpy(gApplication_path, "/tmp");
|
||||
strcpy(gDir_separator, "/");
|
||||
|
||||
BrV1dbBeginWrapper_Float();
|
||||
}
|
||||
|
||||
void tearDown(void) {
|
||||
|
||||
}
|
||||
|
||||
int main(int pArgc, char **pArgv) {
|
||||
int main(int pArgc, char** pArgv) {
|
||||
|
||||
UNITY_BEGIN();
|
||||
|
||||
// BRSRC13
|
||||
test_brlists_suite();
|
||||
test_fwsetup_suite();
|
||||
test_resource_suite();
|
||||
|
||||
// DETHRACE
|
||||
test_utility_suite();
|
||||
test_loading_suite();
|
||||
test_controls_suite();
|
||||
|
|
|
@ -84,6 +84,7 @@ def unread_line():
|
|||
|
||||
def read_file():
|
||||
state = STATE_NONE
|
||||
current_module = None
|
||||
|
||||
while eof == 0:
|
||||
line = read_line()
|
||||
|
@ -96,10 +97,8 @@ def read_file():
|
|||
match = re.match(module_start_regex, line)
|
||||
if match:
|
||||
|
||||
if len(modules) > 0:
|
||||
m = modules[len(modules)-1]
|
||||
# if 'depth.c' in m['name']:
|
||||
# break
|
||||
if current_module is not None:
|
||||
cleanup_function_args(current_module)
|
||||
|
||||
current_module = {
|
||||
'name': match.group(1),
|
||||
|
@ -131,7 +130,7 @@ def read_file():
|
|||
last_fn = None
|
||||
|
||||
elif local_type == 'NEAR_RTN_386' or local_type == 'FAR_RTN_386':
|
||||
fn = process_function()
|
||||
fn = process_function(current_module)
|
||||
last_fn = fn
|
||||
current_module['functions'].append(fn)
|
||||
|
||||
|
@ -178,22 +177,6 @@ def read_file():
|
|||
|
||||
#os.exit(1)
|
||||
|
||||
# def process_type_names():
|
||||
# for m in modules:
|
||||
# for type_idx in m['types']:
|
||||
# t = m['types'][type_idx]
|
||||
# if t['type'] == 'NAME':
|
||||
|
||||
# target_type = t['type_idx']
|
||||
# if m['types'][target_type]['type'] != 'NAME':
|
||||
# #print m['types'][target_type]['type'], t['value'], t['name']
|
||||
# m['types'][target_type]['type_name'] = t['value']
|
||||
# else:
|
||||
# pass
|
||||
# #print (t)
|
||||
# #print (m['types'][target_type])
|
||||
# #print ()
|
||||
|
||||
def process_global_var():
|
||||
glob = {}
|
||||
line = read_line()
|
||||
|
@ -203,7 +186,7 @@ def process_global_var():
|
|||
glob['type'] = match.group(3)
|
||||
return glob
|
||||
|
||||
def process_function():
|
||||
def process_function(module):
|
||||
fn = { 'args': [], 'local_vars': [] }
|
||||
|
||||
#start off = 00000000, code size = 000000C9, parent off = 0000
|
||||
|
@ -305,6 +288,7 @@ def process_type(current_module, type_name):
|
|||
# number of fields = 000D size = 00000034
|
||||
match = re.match(FIELD_LIST_REGEX, line)
|
||||
nbr_fields = int(match.group(1), 16)
|
||||
struct_size = int(match.group(2), 16)
|
||||
fields = []
|
||||
for i in range(nbr_fields):
|
||||
line = read_line()
|
||||
|
@ -321,7 +305,7 @@ def process_type(current_module, type_name):
|
|||
field['bit_size'] = int(match.group(2))
|
||||
#print field
|
||||
fields.append(field)
|
||||
return { 'size': int(match.group(2), 16), 'fields': fields }
|
||||
return { 'size': struct_size, 'fields': fields }
|
||||
elif type_name == 'ENUM_LIST':
|
||||
match = re.match(ENUM_LIST_REGEX, line)
|
||||
nbr_fields = int(match.group(1), 16)
|
||||
|
@ -395,31 +379,6 @@ def resolve_type_str(module, type_idx, var_name, decl=True):
|
|||
#print 'resolved to', type_idx, t
|
||||
#return resolve_name_for_type(module, type_idx) + ' ' + indirections + '{}' + bounds
|
||||
|
||||
|
||||
# def resolve_type(module, type_idx):
|
||||
# result=''
|
||||
# t = module['types'][type_idx]
|
||||
# while 'base_type' in t:
|
||||
# if t['type'] == 'NEAR386 PTR' or t['type'] == 'FAR386 PTR':
|
||||
# result = '*' + result
|
||||
# t = module['types'][t['base_type']]
|
||||
# elif t['type'] == 'WORD_INDEX ARRAY' or t['type'] == 'BYTE_INDEX ARRAY':
|
||||
# inner_type = resolve_type(module, t['base_type'])
|
||||
# return inner_type + '[' + str(t['upper_bound']) + ']'
|
||||
|
||||
# if t['type'] == 'NEAR386 PROC':
|
||||
# return resolve_type(module, t['return_type']) + '(*' + describe_args(module, t, False) + result
|
||||
# if 'value' in t:
|
||||
# return t['value'] + result
|
||||
# else:
|
||||
# t2 = get_child_reference(module, type_idx)
|
||||
# if t2 is not None:
|
||||
# return t2['value'] + result
|
||||
|
||||
# print (t)
|
||||
# return t['type_name'] + result
|
||||
|
||||
|
||||
def resolve_function_header(module, fn):
|
||||
text = ''
|
||||
text += '// Offset: ' + str(fn['offset']) + '\n// Size: ' + str(fn['size'])
|
||||
|
@ -428,8 +387,20 @@ def resolve_function_header(module, fn):
|
|||
text += '\n'
|
||||
name = fn['local_vars'][i]['name']
|
||||
text += '// ' + fn['args'][i] + ': ' + name
|
||||
text += '\n//IDA: ' + resolve_function_ida_signature(module, fn)
|
||||
return text
|
||||
|
||||
def cleanup_function_args(module):
|
||||
# if theres a single "void" argument for a function, we just remove it
|
||||
for fn in module['functions']:
|
||||
type_idx = fn['type']
|
||||
fn_type = module['types'][type_idx]
|
||||
if len(fn_type['args']) == 1:
|
||||
arg_type = resolve_type_str(module, fn_type['args'][0], '')
|
||||
if arg_type == 'void':
|
||||
fn_type['args'] = []
|
||||
|
||||
|
||||
def get_function_arg_count(module, fn):
|
||||
type_idx = fn['type']
|
||||
fn_type = module['types'][type_idx]
|
||||
|
@ -456,13 +427,9 @@ def resolve_function_signature(module, fn):
|
|||
continue
|
||||
else:
|
||||
arg_type = module['types'][arg]
|
||||
if 'value' in arg_type and arg_type['value'] == 'void':
|
||||
continue
|
||||
|
||||
name = fn['local_vars'][i]['name']
|
||||
arg_type = resolve_type_str(module, arg, name, False)
|
||||
if arg_type == 'void ?no_name?':
|
||||
continue
|
||||
if len(args) != 0:
|
||||
args += ', '
|
||||
args += arg_type
|
||||
|
@ -472,13 +439,45 @@ def resolve_function_signature(module, fn):
|
|||
|
||||
return return_type + ' ' + fn['name'] + '(' + args + ')'
|
||||
|
||||
def resolve_function_ida_signature(module, fn):
|
||||
type_idx = fn['type']
|
||||
fn_type = module['types'][type_idx]
|
||||
return_type = resolve_type_str(module, fn_type['return_type'], "")
|
||||
args = ''
|
||||
for i in range(len(fn_type['args'])):
|
||||
arg = fn_type['args'][i]
|
||||
|
||||
if arg not in module['types']:
|
||||
continue
|
||||
else:
|
||||
arg_type = module['types'][arg]
|
||||
|
||||
name = fn['local_vars'][i]['name']
|
||||
arg_type = resolve_type_str(module, arg, name, False)
|
||||
if len(args) != 0:
|
||||
args += ', '
|
||||
args += arg_type
|
||||
if i < len(fn['args']):
|
||||
args += '@<' + fn['args'][i] + '>'
|
||||
|
||||
if is_function_vararg(module, fn):
|
||||
args += ', ...'
|
||||
|
||||
# void __usercall PathCat(char *pDestn_str@<eax>, char *pStr_1@<edx>, char *pStr_2@<ebx>)
|
||||
# float __usercall GetAFloat@<st0>(FILE *pF@<eax>)
|
||||
return_reg = ''
|
||||
if len(fn['args']) > 0 and 'return_value' in fn:
|
||||
return_reg = '@<' + fn['return_value'] + '>'
|
||||
call_type = '__cdecl'
|
||||
if len(fn['args']) > 0:
|
||||
call_type = '__usercall'
|
||||
return return_type + ' ' + call_type + ' ' + fn['name'] + return_reg + '(' + args + ')'
|
||||
|
||||
def describe_args(module, fn_type, resolve_names):
|
||||
args = ''
|
||||
for i in range(len(fn_type['args'])):
|
||||
arg = fn_type['args'][i]
|
||||
arg_type = resolve_type_str(module, arg, '')
|
||||
if arg_type == 'void':
|
||||
continue
|
||||
if resolve_names:
|
||||
name = fn['local_vars'][i]['name']
|
||||
|
||||
|
@ -547,6 +546,7 @@ def get_type_declaration(module, t, name):
|
|||
if tag_name is not None:
|
||||
s += ' ' + tag_name
|
||||
s += ' {'
|
||||
s += '\t\t// size: ' + str(t['size'])
|
||||
first_elem = True
|
||||
for e in reversed(t['fields']):
|
||||
s += '\n'
|
||||
|
@ -555,6 +555,7 @@ def get_type_declaration(module, t, name):
|
|||
if e['type'] == 'BIT_BYTE':
|
||||
s += ': ' + str(e['bit_size'])
|
||||
s += ';'
|
||||
s += '\t\t// @' + str(e['offset'])
|
||||
first_elem = False
|
||||
s += '\n' + ' ' * (indent * INDENT_SPACES) + '}'
|
||||
return s
|
||||
|
@ -656,10 +657,6 @@ def generate_c_file(module):
|
|||
|
||||
# skip local variables that were passed in as arguments
|
||||
arg_count = get_function_arg_count(module, fn)
|
||||
# if fn['name'] == 'DrawColumns':
|
||||
# print 'xxxx'
|
||||
# print fn
|
||||
# print module['types'][fn['type']]
|
||||
for v in fn['local_vars'][arg_count:]:
|
||||
c_file.write(' ' * INDENT_SPACES)
|
||||
if 'CONST' in v['addr_type']:
|
||||
|
@ -692,23 +689,33 @@ def generate_types_header(module):
|
|||
if t['type'] != 'NAME':
|
||||
continue
|
||||
type_name = t['value']
|
||||
if type_name in generated_type_names:
|
||||
# skip duplicates
|
||||
continue
|
||||
|
||||
|
||||
if type_name == 'br_value_tag':
|
||||
print ('!!br_value_tag', type_name in generated_type_names)
|
||||
if type_name == 'br_value':
|
||||
print ('!!br_value', type_name in generated_type_names)
|
||||
|
||||
|
||||
cache_type_name = type_name
|
||||
|
||||
# get type that this name references
|
||||
t = module['types'][t['type_idx']]
|
||||
if t is None:
|
||||
continue
|
||||
|
||||
generated_type_names[type_name] = 1
|
||||
if t['type'] == 'FIELD_LIST':
|
||||
if len(t['fields']) == 0:
|
||||
print("skipping", type_name, "it has no fields")
|
||||
continue
|
||||
cache_type_name = '+' + cache_type_name + '|' + str(len(t['fields']))
|
||||
found_prefix = False
|
||||
found = ''
|
||||
for x in generated_type_names:
|
||||
if '+' + type_name + '|' in x:
|
||||
found_prefix=True
|
||||
found = x
|
||||
if found_prefix and cache_type_name not in generated_type_names:
|
||||
print('CACHEFOUND:', found, cache_type_name)
|
||||
|
||||
if cache_type_name in generated_type_names:
|
||||
# skip duplicates
|
||||
continue
|
||||
|
||||
generated_type_names[cache_type_name] = 1
|
||||
|
||||
if t['type'] == 'ENUM_LIST':
|
||||
s = '\ntypedef enum {} {{'.format(type_name)
|
||||
|
|
Loading…
Reference in New Issue