KAZIK/tools/tests/billiards_benchmark.asm
Игорь Федосеев ca62db53e9 feat: implement native billiards, scratch tickets, first-person dice, and city wake scene
- Billiards: add native Russian Pyramid & American Eight-Ball pool with physics prediction, controls, and regression tests
- Scratch Tickets: add dedicated counter, mat presentation, elliptical coin scraping, 4 ticket types, and payout effects
- First-Person Dice: add native dice scene, hand anchor frames, throwing animation, and table perspective
- City Wake & Weather: add arrival cutscene, alley geometry, weather/rain effects, and lighter/rocker animation
- World Dressing: add hall paintings, furniture packs, hall lighting, and scene regression tests
- Build & Tooling: update build.bat for modern MSVC toolchain, update launcher hash, and refresh shipping binaries
2026-10-16 12:37:40 +03:00

54 lines
1.6 KiB
NASM

; Headless timing of the real shipping integrator and cached predictor.
.386
.model flat,stdcall
option casemap:none
include F:\MASM32\masm32\include\windows.inc
include F:\MASM32\masm32\include\kernel32.inc
include F:\MASM32\masm32\include\user32.inc
InitPaths3D PROTO
StartBilliards3D PROTO :DWORD
PoolPredict3D PROTO
FreePyramidAssets3D PROTO
.data
benchText db "Billiards shipping predictor: fresh break %lu us; 1000 cached calls %lu us",13,10,0
benchMicroseconds REAL8 1000000.0
benchBuffer db 128 dup(0)
.code
RunBilliardsBenchmark PROC uses ebx esi edi
local started:QWORD,finished:QWORD,frequency:QWORD,fresh:DWORD,cached:DWORD,written:DWORD
call InitPaths3D
invoke StartBilliards3D,0
invoke QueryPerformanceFrequency,ADDR frequency
invoke QueryPerformanceCounter,ADDR started
call PoolPredict3D
invoke QueryPerformanceCounter,ADDR finished
fild finished
fild started
fsubp st(1),st(0)
fmul benchMicroseconds
fild frequency
fdivp st(1),st(0)
fistp fresh
invoke QueryPerformanceCounter,ADDR started
mov esi,1000
bench_cache:
call PoolPredict3D
dec esi
jnz bench_cache
invoke QueryPerformanceCounter,ADDR finished
fild finished
fild started
fsubp st(1),st(0)
fmul benchMicroseconds
fild frequency
fdivp st(1),st(0)
fistp cached
invoke wsprintfA,OFFSET benchBuffer,OFFSET benchText,fresh,cached
mov ebx,eax
invoke GetStdHandle,STD_OUTPUT_HANDLE
mov edi,eax
invoke WriteFile,edi,OFFSET benchBuffer,ebx,ADDR written,0
call FreePyramidAssets3D
invoke ExitProcess,0
RunBilliardsBenchmark ENDP
END