Changeset 275 for Daodan


Ignore:
Timestamp:
Mar 18, 2009, 8:14:58 AM (16 years ago)
Author:
rossy
Message:

Performance patch test

Location:
Daodan
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • Daodan/build.bat

    r271 r275  
    1 gcc -O3 -s -Wall -shared -o build\binkw32.dll src\Oni_Symbols.S src\Daodan.c src\Daodan_DLLStubs.c src\Daodan_Patch.c src\Daodan_Utility.c
     1gcc -O3 -s -Wall -shared -fomit-frame-pointer -o build\binkw32.dll src\Oni_Symbols.S src\Daodan.c src\Daodan_DLLStubs.c src\Daodan_Patch.c src\Daodan_Utility.c
  • Daodan/src/BFW_Utility.h

    r272 r275  
    44
    55#include <stdio.h>
     6#include <stdint.h>
     7#include "Daodan.h"
    68
    79void __cdecl UUrStartupMessage(const char* fmt, ...);
     10int64_t ONICALL UUrMachineTime_High();
     11double  ONICALL UUrMachineTime_High_Frequency();
    812
    913extern FILE* ONgFileStartup;
  • Daodan/src/Daodan.c

    r274 r275  
    6363        DDrPatch_MakeJump(UUrStartupMessage, DDrStartupMessage);
    6464       
     65        // Test performance patch
     66        DDrPatch_MakeJump(UUrMachineTime_High, DDrMachineTime_High);
     67        DDrPatch_MakeJump(UUrMachineTime_High_Frequency, DDrMachineTime_High_Frequency);
     68       
    6569        ONiMain(argc, argv);
    6670}
  • Daodan/src/Daodan_DLLStubs.c

    r272 r275  
    11
    2 __declspec(dllexport) void VTPauseSampling() {return;}
    3 __declspec(dllexport) void VTResumeSampling() {return;}
     2__declspec(dllexport) void __cdecl VTPauseSampling() {return;}
     3__declspec(dllexport) void __cdecl VTResumeSampling() {return;}
    44
    55__declspec(dllexport) int __stdcall _BinkBufferClose(int arg1) {return 0;}
  • Daodan/src/Daodan_Utility.c

    r272 r275  
     1#include <windows.h>
    12#include <stdlib.h>
    23#include <stdarg.h>
     4#include <stdint.h>
    35#include "oni_stdio.h"
    46
     
    2527        return;
    2628}
     29
     30int64_t DDrMachineTime_High()
     31{
     32//      LARGE_INTEGER PerfCount;
     33//     
     34//      if (!QueryPerformanceCounter(&PerfCount))
     35//              PerfCount.QuadPart = GetTickCount();
     36//     
     37//      return PerfCount.QuadPart;
     38        return GetTickCount();
     39}
     40
     41double DDrMachineTime_High_Frequency()
     42{
     43//      LARGE_INTEGER Frequency;
     44//
     45//      if (!QueryPerformanceFrequency(&Frequency))
     46                return 1000.0;
     47
     48//      return Frequency.QuadPart;
     49}
  • Daodan/src/Daodan_Utility.h

    r272 r275  
    33#define DAODAN_UTILITY_H
    44
     5#include <stdint.h>
     6#include "Daodan.h"
     7
    58void __cdecl DDrStartupMessage(const char* fmt, ...);
     9int64_t ONICALL DDrMachineTime_High();
     10double  ONICALL DDrMachineTime_High_Frequency();
    611
    712#endif
  • Daodan/src/Oni_Symbols.S

    r274 r275  
    22
    33// MSVC6.0 stdlib
    4 symbol ( _oni_malloc           , 0x0011fc24 )
    5 symbol ( _oni_free             , 0x0011fbf5 )
     4symbol ( _oni_malloc                      , 0x0011fc24 )
     5symbol ( _oni_free                        , 0x0011fbf5 )
    66
    7 symbol ( _oni_fopen            , 0x0011ea9f )
    8 symbol ( _oni_fflush           , 0x0011eab2 )
    9 symbol ( _oni_fprintf          , 0x0011ebbf )
    10 symbol ( _oni_vsprintf         , 0x0011e860 )
     7symbol ( _oni_fopen                       , 0x0011ea9f )
     8symbol ( _oni_fflush                      , 0x0011eab2 )
     9symbol ( _oni_fprintf                     , 0x0011ebbf )
     10symbol ( _oni_vsprintf                    , 0x0011e860 )
    1111
    1212// Oni Engine
    13 symbol ( _ONiMain              , 0x000d3280 )
     13symbol ( _ONiMain                         , 0x000d3280 )
    1414
    1515// BFW_Utility
    16 symbol ( _UUrStartupMessage    , 0x00024860 )
    17 symbol ( _ONgFileStartup       , 0x001711b8 )
     16symbol ( _UUrStartupMessage               , 0x00024860 )
     17symbol ( @UUrMachineTime_High@0           , 0x00026480 )
     18symbol ( @UUrMachineTime_High_Frequency@0 , 0x000264b0 )
     19symbol ( _ONgFileStartup                  , 0x001711b8 )
Note: See TracChangeset for help on using the changeset viewer.