KAZIK/tools/tests/city_lighting_test.inc
Artvasil09 3ad5bf4c9d Develop assembly-only casino scenes and native games
Add native Durak, poker, blackjack, roulette, Buckshot and billiards scenes with animation assets and regression tests. Improve arrival, city, hall, profiles, shops, audio and exit handling; remove the portable C game core and refresh shipping executables.
2026-10-08 22:39:19 +03:00

92 lines
2.7 KiB
PHP

.data
cityLightOnPath3D db "build\actions\street-light-on.bmp",0
cityLightOffPath3D db "build\actions\street-light-off.bmp",0
cityLightPerfPath3D db "build\actions\street-light-perf.bin",0
cityLightPerf3D dd 2 dup(0)
.code
RunCityLightingTest3D PROC uses ebx esi edi
local savedSeed:DWORD,bank:DWORD,start:DWORD,count:DWORD,handle:DWORD
mov eax, rngSeed3D
mov savedSeed, eax
mov eax, bankroll
mov bank, eax
call BuildCityLighting3D
mov cityLighting3D, 1
invoke SampleCityLight3D, 17*FP_1, FP_1*259/20
cmp eax, 230
jb city_light_test_fail
invoke SampleCityLight3D, 17*FP_1, 11*FP_1
cmp eax, 320
ja city_light_test_fail
invoke SampleCityLight3D, -1, 14*FP_1
test eax, eax
jnz city_light_test_fail
invoke SampleCityLight3D, 64*FP_1, 14*FP_1
test eax, eax
jnz city_light_test_fail
invoke SampleCityLight3D, 1*FP_1, 32*FP_1
test eax, eax
jnz city_light_test_fail
invoke IsCityEmissive3D, 00E9B149h, 65
cmp eax, 1
jne city_light_test_fail
invoke IsCityEmissive3D, 00E9B149h, 57
test eax, eax
jnz city_light_test_fail
invoke IsCityEmissive3D, 00182030h, 65
test eax, eax
jnz city_light_test_fail
mov cityLighting3D, 0
invoke SampleCityLight3D, 17*FP_1, FP_1*259/20
test eax, eax
jnz city_light_test_fail
invoke IsCityEmissive3D, 00E9B149h, 65
test eax, eax
jnz city_light_test_fail
mov arrivalState3D, ARRIVAL_WALK
mov cityPhase3D, CITY_STREET
mov cityTime3D, 2500
mov cityClock3D, 18000
call RenderCityArrival3D
invoke WriteActionSnapshot3D, OFFSET cityLightOffPath3D
test eax, eax
jz city_light_test_fail
mov cityLighting3D, 1
call RenderCityArrival3D
invoke WriteActionSnapshot3D, OFFSET cityLightOnPath3D
test eax, eax
jz city_light_test_fail
xor esi, esi
city_light_perf_mode:
mov cityLighting3D, esi
invoke GetTickCount
mov start, eax
mov ebx, 12
city_light_perf_frame:
call RenderCityArrival3D
dec ebx
jnz city_light_perf_frame
invoke GetTickCount
sub eax, start
mov cityLightPerf3D[esi*4], eax
inc esi
cmp esi, 2
jb city_light_perf_mode
invoke CreateFileA, OFFSET cityLightPerfPath3D, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0
cmp eax, INVALID_HANDLE_VALUE
je city_light_test_fail
mov handle, eax
invoke WriteFile, handle, OFFSET cityLightPerf3D, 8, ADDR count, 0
invoke CloseHandle, handle
mov eax, savedSeed
cmp rngSeed3D, eax
jne city_light_test_fail
mov eax, bank
cmp bankroll, eax
jne city_light_test_fail
xor eax, eax
ret
city_light_test_fail:
mov eax, 281
ret
RunCityLightingTest3D ENDP