Implement 32x32 BFS visitor navigation and daily contracts system with companion .npc journals; add native assembly scenes for Clover slots, Pyramid cards, Blackjack Party and Russian Party; package animation and sprite packs; add comprehensive offline test suites and rebuild shipping binaries.
257 lines
7.3 KiB
PHP
257 lines
7.3 KiB
PHP
.data
|
|
streetTestPaths3D dd OFFSET streetStartPath3D,OFFSET streetEarlyPath3D,OFFSET streetMiddlePath3D
|
|
dd OFFSET streetLatePath3D,OFFSET streetEndPath3D,OFFSET streetTurnPath3D
|
|
streetStartPath3D db "build\actions\street-v5-0.bmp",0
|
|
streetEarlyPath3D db "build\actions\street-v5-1.bmp",0
|
|
streetMiddlePath3D db "build\actions\street-v5-2.bmp",0
|
|
streetLatePath3D db "build\actions\street-v5-3.bmp",0
|
|
streetEndPath3D db "build\actions\street-v5-4.bmp",0
|
|
streetTurnPath3D db "build\actions\street-v5-5.bmp",0
|
|
streetDoorPath3D db "build\actions\street-v5-door.bmp",0
|
|
streetReportPath3D db "build\actions\street-visibility-v5.bin",0
|
|
streetTypeVisible3D dd 8 dup(0)
|
|
streetPersonVisible3D dd CITY_PEDESTRIAN_COUNT dup(0)
|
|
streetLastX3D dd CITY_PEDESTRIAN_COUNT dup(0)
|
|
.code
|
|
RunStreetPopulationTest3D PROC uses ebx esi edi
|
|
local clock:DWORD,sample:DWORD,bytes:DWORD,handle:DWORD
|
|
mov hallTestStage3D,7710
|
|
cmp hallStreetLife3D.pixels,0
|
|
je street_test_fail
|
|
call PrepareCityStreetCrops3D
|
|
; Every registered street prop has an opaque crop and an empty map cell.
|
|
xor esi,esi
|
|
street_test_prop:
|
|
imul ebx,esi,SIZEOF CityProp3D
|
|
cmp cityObjects3D[ebx].asset,OFFSET hallPatrons3D
|
|
je street_test_fail
|
|
cmp cityObjects3D[ebx].asset,OFFSET hallStreetLife3D
|
|
jne @F
|
|
cmp cityObjects3D[ebx].frame,32
|
|
je street_test_fail
|
|
cmp cityObjects3D[ebx].frame,37
|
|
je street_test_fail
|
|
@@:
|
|
mov eax,cityObjects3D[ebx].posX
|
|
sar eax,16
|
|
mov ecx,cityObjects3D[ebx].posY
|
|
sar ecx,16
|
|
cmp eax,32
|
|
jae street_test_prop_next
|
|
shl ecx,5
|
|
add eax,ecx
|
|
cmp cityMap3D[eax],0
|
|
jne street_test_fail
|
|
street_test_prop_next:
|
|
inc esi
|
|
cmp esi,CITY_PROP_COUNT
|
|
jb street_test_prop
|
|
xor esi,esi
|
|
street_test_crop:
|
|
imul ebx,esi,SIZEOF CitySpriteCrop3D
|
|
cmp cityStreetCrops3D[ebx].pixelW,0
|
|
je street_test_fail
|
|
cmp cityStreetCrops3D[ebx].pixelH,0
|
|
je street_test_fail
|
|
inc esi
|
|
cmp esi,8
|
|
jb street_test_crop
|
|
; Full out-and-back cycles stay on a curb and never jump more than one step.
|
|
mov hallTestStage3D,7711
|
|
mov clock,0
|
|
street_test_walk:
|
|
mov eax,clock
|
|
mov cityClock3D,eax
|
|
call AnimateCityPedestrians3D
|
|
xor esi,esi
|
|
street_test_person:
|
|
imul ebx,esi,SIZEOF CityWalkRoute3D
|
|
add ebx,OFFSET cityWalkRoutes3D
|
|
imul edi,[ebx].CityWalkRoute3D.objectIndex,SIZEOF CityProp3D
|
|
mov eax,cityObjects3D[edi].posX
|
|
cmp eax,[ebx].CityWalkRoute3D.minX
|
|
jl street_test_fail
|
|
cmp eax,[ebx].CityWalkRoute3D.maxX
|
|
jg street_test_fail
|
|
mov edx,eax
|
|
sub eax,streetLastX3D[esi*4]
|
|
test eax,eax
|
|
jns @F
|
|
neg eax
|
|
@@:
|
|
cmp clock,0
|
|
je @F
|
|
cmp eax,FP_1/8
|
|
ja street_test_fail
|
|
@@:
|
|
mov streetLastX3D[esi*4],edx
|
|
mov eax,cityObjects3D[edi].posX
|
|
sar eax,16
|
|
mov ecx,cityObjects3D[edi].posY
|
|
sar ecx,16
|
|
cmp eax,32
|
|
jae street_test_extended_cell
|
|
shl ecx,5
|
|
add eax,ecx
|
|
cmp cityMap3D[eax],0
|
|
jne street_test_fail
|
|
jmp street_test_cell_clear
|
|
street_test_extended_cell:
|
|
; The continuation district is world-space geometry, not another 32x32 tile row.
|
|
cmp ecx,12
|
|
jb street_test_fail
|
|
cmp ecx,17
|
|
jae street_test_fail
|
|
cmp eax,96
|
|
jae street_test_fail
|
|
push ebx
|
|
push esi
|
|
mov eax,cityObjects3D[edi].posX
|
|
mov ecx,cityObjects3D[edi].posY
|
|
xor esi,esi
|
|
street_test_backdrop_clear:
|
|
imul ebx,esi,SIZEOF CityBuilding3D
|
|
cmp eax,citySkyline3D[ebx].minX
|
|
jl street_test_backdrop_next
|
|
cmp eax,citySkyline3D[ebx].maxX
|
|
jge street_test_backdrop_next
|
|
cmp ecx,citySkyline3D[ebx].minY
|
|
jl street_test_backdrop_next
|
|
cmp ecx,citySkyline3D[ebx].maxY
|
|
jl street_test_backdrop_blocked
|
|
street_test_backdrop_next:
|
|
inc esi
|
|
cmp esi,CITY_DISTANT_BUILDINGS
|
|
jb street_test_backdrop_clear
|
|
pop esi
|
|
pop ebx
|
|
jmp street_test_cell_clear
|
|
street_test_backdrop_blocked:
|
|
pop esi
|
|
pop ebx
|
|
jmp street_test_fail
|
|
street_test_cell_clear:
|
|
cmp cityObjects3D[edi].worldH,FP_1*7/5
|
|
ja street_test_fail
|
|
mov eax,cityObjects3D[edi].frame
|
|
sub eax,[ebx].CityWalkRoute3D.firstFrame
|
|
cmp eax,15
|
|
ja street_test_fail
|
|
inc esi
|
|
cmp esi,CITY_PEDESTRIAN_COUNT
|
|
jb street_test_person
|
|
add clock,100
|
|
cmp clock,96000
|
|
jbe street_test_walk
|
|
; Count only pixels surviving nearer street props, not projected rectangles.
|
|
lea edi,streetTypeVisible3D
|
|
xor eax,eax
|
|
mov ecx,8+CITY_PEDESTRIAN_COUNT
|
|
rep stosd
|
|
mov arrivalState3D,ARRIVAL_WALK
|
|
mov cityPhase3D,CITY_STREET
|
|
mov sample,0
|
|
street_test_render:
|
|
mov eax,sample
|
|
mov cityTime3D,eax
|
|
add eax,15200
|
|
mov cityClock3D,eax
|
|
call RenderCityArrival3D
|
|
mov eax,cityBenchVisible3D
|
|
add streetTypeVisible3D,eax
|
|
xor esi,esi
|
|
street_test_type:
|
|
imul ebx,esi,SIZEOF CityProp3D
|
|
cmp cityObjects3D[ebx].asset,OFFSET hallStreetLife3D
|
|
jne street_test_type_next
|
|
mov eax,cityObjects3D[ebx].frame
|
|
sub eax,32
|
|
cmp eax,8
|
|
jae street_test_type_next
|
|
mov edx,cityVisiblePixels3D[esi*4]
|
|
add streetTypeVisible3D[eax*4],edx
|
|
street_test_type_next:
|
|
inc esi
|
|
cmp esi,CITY_PROP_COUNT
|
|
jb street_test_type
|
|
xor esi,esi
|
|
street_test_person_pixels:
|
|
imul ebx,esi,SIZEOF CityWalkRoute3D
|
|
mov eax,cityWalkRoutes3D[ebx].objectIndex
|
|
mov eax,cityVisiblePixels3D[eax*4]
|
|
add streetPersonVisible3D[esi*4],eax
|
|
inc esi
|
|
cmp esi,CITY_PEDESTRIAN_COUNT
|
|
jb street_test_person_pixels
|
|
mov eax,sample
|
|
xor edx,edx
|
|
mov ecx,1500
|
|
div ecx
|
|
test edx,edx
|
|
jnz street_test_next_frame
|
|
mov eax,streetTestPaths3D[eax*4]
|
|
invoke WriteActionSnapshot3D,eax
|
|
street_test_next_frame:
|
|
add sample,500
|
|
cmp sample,7500
|
|
jbe street_test_render
|
|
; Entrance walkers appear during the approach, then leave the close camera's FOV.
|
|
mov cityPhase3D,CITY_DOOR
|
|
mov sample,0
|
|
street_test_entry_approach:
|
|
mov eax,sample
|
|
mov cityTime3D,eax
|
|
add eax,23600
|
|
mov cityClock3D,eax
|
|
call RenderCityArrival3D
|
|
mov esi,4
|
|
street_test_entry_pixels:
|
|
imul ebx,esi,SIZEOF CityWalkRoute3D
|
|
mov eax,cityWalkRoutes3D[ebx].objectIndex
|
|
mov eax,cityVisiblePixels3D[eax*4]
|
|
add streetPersonVisible3D[esi*4],eax
|
|
inc esi
|
|
cmp esi,CITY_PEDESTRIAN_COUNT
|
|
jb street_test_entry_pixels
|
|
add sample,100
|
|
cmp sample,2800
|
|
jbe street_test_entry_approach
|
|
mov cityTime3D,1100
|
|
mov cityClock3D,24700
|
|
call RenderCityArrival3D
|
|
invoke WriteActionSnapshot3D,OFFSET streetDoorPath3D
|
|
invoke CreateFileA,OFFSET streetReportPath3D,GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0
|
|
cmp eax,INVALID_HANDLE_VALUE
|
|
je street_test_fail
|
|
mov handle,eax
|
|
invoke WriteFile,handle,OFFSET streetTypeVisible3D,(8+CITY_PEDESTRIAN_COUNT)*4,ADDR bytes,0
|
|
invoke CloseHandle,handle
|
|
mov hallTestStage3D,7712
|
|
xor esi,esi
|
|
street_test_type_visible:
|
|
cmp esi,5
|
|
jne @F
|
|
cmp streetTypeVisible3D[esi*4],0
|
|
jne street_test_fail
|
|
jmp street_test_type_checked
|
|
@@:
|
|
cmp streetTypeVisible3D[esi*4],128
|
|
jb street_test_fail
|
|
street_test_type_checked:
|
|
inc esi
|
|
cmp esi,8
|
|
jb street_test_type_visible
|
|
mov hallTestStage3D,7713
|
|
xor esi,esi
|
|
street_test_people_visible:
|
|
cmp streetPersonVisible3D[esi*4],128
|
|
jb street_test_fail
|
|
inc esi
|
|
cmp esi,CITY_PEDESTRIAN_COUNT
|
|
jb street_test_people_visible
|
|
mov eax,1
|
|
ret
|
|
street_test_fail:
|
|
xor eax,eax
|
|
ret
|
|
RunStreetPopulationTest3D ENDP
|