Subversion Repositories Games.Carmageddon

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #include "mem.h"
  2.  
  3. #include "CORE/FW/fwsetup.h"
  4. #include "CORE/STD/brstdlib.h"
  5. #include "harness/trace.h"
  6.  
  7. // IDA: void* __cdecl BrMemAllocate(br_size_t size, br_uint_8 type)
  8. void* BrMemAllocate(br_size_t size, br_uint_8 type) {
  9.     void* b;
  10.     LOG_TRACE10("(%d, %d)", size, type);
  11.  
  12.     b = fw.mem->allocate(size, type);
  13.     BrMemSet(b, 0, size);
  14.     return b;
  15. }
  16.  
  17. // IDA: void __cdecl BrMemFree(void *block)
  18. void BrMemFree(void* block) {
  19.     LOG_TRACE10("(%p)", block);
  20.     fw.mem->free(block);
  21. }
  22.  
  23. // IDA: br_size_t __cdecl BrMemInquire(br_uint_8 type)
  24. br_size_t BrMemInquire(br_uint_8 type) {
  25.     br_size_t i;
  26.     i = fw.mem->inquire(type);
  27.     return i;
  28. }
  29.  
  30. // IDA: br_int_32 __cdecl BrMemAlign(br_uint_8 type)
  31. br_int_32 BrMemAlign(br_uint_8 type) {
  32.     br_int_32 i = 0;
  33.     if (fw.mem->align) {
  34.         i = fw.mem->align(type);
  35.     }
  36.     return i;
  37. }
  38.  
  39. // IDA: void* __cdecl BrMemCalloc(int nelems, br_size_t size, br_uint_8 type)
  40. void* BrMemCalloc(int nelems, br_size_t size, br_uint_8 type) {
  41.     void* b;
  42.     b = fw.mem->allocate(nelems * size, type);
  43.     BrMemSet(b, 0, nelems * size);
  44.     return b;
  45. }
  46.  
  47. // IDA: char* __cdecl BrMemStrDup(char *str)
  48. char* BrMemStrDup(char* str) {
  49.     //int l; // Pierre-Marie Baty -- unused variable
  50.     //char* nstr; // Pierre-Marie Baty -- unused variable
  51.     LOG_TRACE("(\"%s\")", str);
  52.     NOT_IMPLEMENTED();
  53. }
  54.