QUOTE (LOst @ Feb 14 2011, 06:03 AM)
QUOTE (sonic4dude @ Feb 14 2011, 02:48 AM)
Wow, this game has quite a lot of threads running at the same time, and a lot of loaded SPRX files (sort of like relocatable unix .so). :-).
The entire game takes up 188MB of memory. That's a lot! On PS3, we only have 256MB, and 211MB is usable for process. :-).
Remember, I captured process state at title screen/SEGA screen, during game, we'd see even more memory usage. That's some blast processing!
Can you tell me how many threads are active (running supposedly at the same time)? This is one of the critical things I am facing (see my description to know what I am up to). The amount of RAM usage is expected because Sonic 4 uses alot of huge quality textures. This information is great! I hope you will become a Tech Member.
Memory allocation seems static to me. 188MB of RAM is allocated during process startup, and during levels and title screen and all, no more RAM is allocated, it always uses the same amount of local memory. At most I see 4 threads executing, DRAW_THREAD, <PID>_main_EBOOT.BIN (main executable on PS3), _gcm_int_thread (libgcm, does 3D/drawing on PS3 platform, very good when GCM for DEX debugger SPRX is loaded, you can then capture VRAM remotely. :-)), and _cellsurMixerMain for audio. During Movies, they use the cri* threads for rendering, here's some debug output from Unleashed (Sonic 4 doesn't have this output, probably commented out 'printf' :-)):
[CRI ADX] ADX created the thread : name=cri_adxm_vv_proc, id=17105064(0x10500a8), priority=100(0x64)
[CRI ADX] ADX created the thread : name=cri_adxm_vsync_proc, id=17105065(0x10500a9), priority=500(0x1f4)
[CRI ADX] ADX created the thread : name=cri_adxm_fs_proc, id=17105066(0x10500aa), priority=600(0x258)
[CRI ADX] ADX created the thread : name=cri_adxm_idle_proc, id=17105067(0x10500ab), priority=1500(0x5dc)
[CRI ADX] ADX created the thread : name=cri_adxm_vv_proc, id=17105070(0x10500ae), priority=100(0x64)
[CRI ADX] ADX created the thread : name=cri_adxm_vsync_proc, id=17105071(0x10500af), priority=500(0x1f4)
[CRI ADX] ADX created the thread : name=cri_adxm_fs_proc, id=17105072(0x10500b0), priority=600(0x258)
[CRI ADX] ADX created the thread : name=cri_adxm_idle_proc, id=17105073(0x10500b1), priority=1500(0x5dc)
Here, they spawn multiple threads for movie, FS, audio, and idle processing threads all simultaneously to decode your introduction videos, but here's a warning, Lv-2 complains about busy loops! :-).
About mutexes created, most come from liblv2.sprx, libfs.sprx, libsysutil.sprx and libmixer.a.
And Lightweight mutexes, most come from libgcc, liblv2, libsysutil, liblv2coredump, libgcm_pm, libc, libfs, libsysutil_np_trophy, libmixer and libio. :-).
EDIT: I found out what the SPUs are doing now, they're decoding audio and video, it's not all done on PPU. Sony/SEGA used the CRI technologies Middleware SDK (FileMajic Pro SDK?) to shorten loading times and decode audio/video very quickly. :-).
Sonic Unleashed also uses this SDK.
I'll look at Sonic 2006's core state later.
EDIT #2: Sonic 4 uses a lot of rendering objects, TextureMatrix, FrontMaterial (Ambient, Diffuse, Specular, Emission, Shininess are all properties), Fog , Lighting (Ambient, Diffuse, Specular, Position, HalfVector, SpotDirection, SpotExponent, SpotCutoff, SpotCosCutoff, ConstantAttenuation, LinearAttenuation, QuadraticAttenuation), DualParaboloidMatrix, TexBaseAlpha, UserUniform, ModelViewMatrix, NormalMatrix, ModelViewProjectionMatrix, Lighting numbers, and ModelViewBoneMatrix/ModelViewNormalBoneMatrix (lots of arrays here!).
This post has been edited by sonic4dude: 14 February 2011 - 08:06 AM