├── Code ├── Core │ ├── Debug.h │ ├── Debug │ │ ├── Assert.cpp │ │ ├── Checks.h │ │ ├── Debug.cpp │ │ ├── Mem_stat.h │ │ ├── Messages.h │ │ ├── Module.h │ │ ├── NGPS │ │ │ └── P_debug.cpp │ │ ├── Project.h │ │ ├── Signatrs.h │ │ ├── Wn32 │ │ │ └── P_debug.cpp │ │ ├── XBox │ │ │ └── p_debug.cpp │ │ ├── log.cpp │ │ └── ngc │ │ │ └── P_debug.cpp │ ├── Defines.h │ ├── DynamicTable.cpp │ ├── DynamicTable.h │ ├── HashTable.h │ ├── List.h │ ├── List │ │ ├── Head.h │ │ ├── Node.h │ │ ├── Search.h │ │ └── list.cpp │ ├── LookupTable.cpp │ ├── LookupTable.h │ ├── Math │ │ ├── Xbox │ │ │ └── sse.h │ │ ├── geometry.cpp │ │ ├── geometry.h │ │ ├── math.cpp │ │ ├── math.h │ │ ├── matrix.cpp │ │ ├── matrix.h │ │ ├── matrix.inl │ │ ├── quat.h │ │ ├── quat.inl │ │ ├── rect.h │ │ ├── rot90.cpp │ │ ├── rot90.h │ │ ├── slerp.cpp │ │ ├── slerp.h │ │ ├── vector.cpp │ │ ├── vector.h │ │ └── vector.inl │ ├── String │ │ ├── CString.cpp │ │ ├── CString.h │ │ ├── stringutils.cpp │ │ └── stringutils.h │ ├── StringHashTable.h │ ├── Support │ │ ├── Lock.h │ │ ├── Ref.h │ │ ├── class.cpp │ │ ├── class.h │ │ └── support.h │ ├── Task.h │ ├── Task │ │ ├── Hook.h │ │ ├── List.h │ │ ├── Stack.h │ │ ├── Task.cpp │ │ ├── Task.h │ │ ├── Tlist.cpp │ │ └── Tstack.cpp │ ├── Thread │ │ ├── ngc │ │ │ ├── t_thread.cpp │ │ │ └── t_thread.h │ │ ├── ngps │ │ │ ├── t_thread.cpp │ │ │ └── t_thread.h │ │ └── wn32 │ │ │ ├── t_thread.cpp │ │ │ └── t_thread.h │ ├── TimestampedFlag.h │ ├── compress.cpp │ ├── compress.h │ ├── crc.cpp │ ├── crc.h │ ├── flags.h │ ├── glue.h │ ├── log.h │ ├── macros.h │ ├── math.h │ ├── singleton.h │ ├── support.h │ └── thread.h ├── GameFlow.txt ├── Gel │ ├── AssMan │ │ ├── AssMan.cpp │ │ ├── AssMan.h │ │ ├── NodeArrayAsset.cpp │ │ ├── NodeArrayAsset.h │ │ ├── animasset.cpp │ │ ├── animasset.h │ │ ├── asset.cpp │ │ ├── asset.h │ │ ├── assettypes.h │ │ ├── cutsceneasset.cpp │ │ ├── cutsceneasset.h │ │ ├── refasset.cpp │ │ ├── refasset.h │ │ ├── skeletonasset.cpp │ │ ├── skeletonasset.h │ │ ├── skinasset.cpp │ │ └── skinasset.h │ ├── Collision │ │ ├── BatchTriColl.cpp │ │ ├── BatchTriColl.h │ │ ├── CollCache.cpp │ │ ├── CollCache.h │ │ ├── CollEnums.h │ │ ├── CollTriData.cpp │ │ ├── CollTriData.h │ │ ├── Collision.cpp │ │ ├── Collision.h │ │ ├── MovCollMan.cpp │ │ └── MovCollMan.h │ ├── Components │ │ ├── BouncyComponent.h │ │ ├── CameraComponent.cpp │ │ ├── CameraComponent.h │ │ ├── CameraLookAroundComponent.cpp │ │ ├── CameraLookAroundComponent.h │ │ ├── CameraUtil.cpp │ │ ├── CameraUtil.h │ │ ├── CollideAndDieComponent.cpp │ │ ├── CollideAndDieComponent.h │ │ ├── FloatingLabelComponent.cpp │ │ ├── FloatingLabelComponent.h │ │ ├── GunslingerCameraLookAroundComponent.cpp │ │ ├── GunslingerWalkCameraComponent.cpp │ │ ├── GunslingerWalkComponent.cpp │ │ ├── HorseCameraComponent.cpp │ │ ├── HorseCameraComponent.h │ │ ├── HorseComponent.cpp │ │ ├── HorseComponent.h │ │ ├── InputComponent.cpp │ │ ├── InputComponent.h │ │ ├── ModelLightUpdateComponent.cpp │ │ ├── ModelLightUpdateComponent.h │ │ ├── MovableContactComponent.cpp │ │ ├── MovableContactComponent.h │ │ ├── NearComponent.cpp │ │ ├── NearComponent.h │ │ ├── NodeArrayComponent.cpp │ │ ├── NodeArrayComponent.h │ │ ├── ObjectHookManagerComponent.cpp │ │ ├── ObjectHookManagerComponent.h │ │ ├── ParticleComponent.cpp │ │ ├── ParticleComponent.h │ │ ├── PedLogicComponent.cpp │ │ ├── PedLogicComponent.h │ │ ├── ProximTriggerComponent.cpp │ │ ├── ProximTriggerComponent.h │ │ ├── RailManagerComponent.cpp │ │ ├── RailManagerComponent.h │ │ ├── RibbonComponent.cpp │ │ ├── RibbonComponent.h │ │ ├── RiderComponent.cpp │ │ ├── RiderComponent.h │ │ ├── SetDisplayMatrixComponent.cpp │ │ ├── SetDisplayMatrixComponent.h │ │ ├── SkaterCameraComponent.cpp │ │ ├── SkaterCameraComponent.h │ │ ├── SkitchComponent.cpp │ │ ├── SkitchComponent.h │ │ ├── StaticVehicleComponent.cpp │ │ ├── StaticVehicleComponent.h │ │ ├── StatsManagerComponent.cpp │ │ ├── StatsManagerComponent.h │ │ ├── StreamComponent.cpp │ │ ├── StreamComponent.h │ │ ├── SuspendComponent.cpp │ │ ├── SuspendComponent.h │ │ ├── TriggerComponent.cpp │ │ ├── TriggerComponent.h │ │ ├── VehicleSoundComponent.cpp │ │ ├── VehicleSoundComponent.h │ │ ├── VelocityComponent.cpp │ │ ├── VelocityComponent.h │ │ ├── VibrationComponent.cpp │ │ ├── VibrationComponent.h │ │ ├── WalkCameraComponent.cpp │ │ ├── WalkCameraComponent.h │ │ ├── WalkComponent.cpp │ │ ├── WalkComponent.h │ │ ├── WalkHangUtil.cpp │ │ ├── WalkLadderUtil.cpp │ │ ├── animationcomponent.cpp │ │ ├── animationcomponent.h │ │ ├── avoidcomponent.cpp │ │ ├── avoidcomponent.h │ │ ├── bouncycomponent.cpp │ │ ├── carphysicscomponent.cpp │ │ ├── carphysicscomponent.h │ │ ├── collisioncomponent.cpp │ │ ├── collisioncomponent.h │ │ ├── emptycomponent.cpp │ │ ├── emptycomponent.h │ │ ├── lockobjcomponent.cpp │ │ ├── lockobjcomponent.h │ │ ├── modelcomponent.cpp │ │ ├── modelcomponent.h │ │ ├── motioncomponent.cpp │ │ ├── motioncomponent.h │ │ ├── rigidbodycomponent.cpp │ │ ├── rigidbodycomponent.h │ │ ├── shadowcomponent.cpp │ │ ├── shadowcomponent.h │ │ ├── skeletoncomponent.cpp │ │ ├── skeletoncomponent.h │ │ ├── soundcomponent.cpp │ │ ├── soundcomponent.h │ │ ├── specialitemcomponent.cpp │ │ ├── specialitemcomponent.h │ │ ├── trickcomponent.cpp │ │ ├── trickcomponent.h │ │ ├── vehiclecameracomponent.cpp │ │ ├── vehiclecameracomponent.h │ │ ├── vehiclecomponent.cpp │ │ ├── vehiclecomponent.h │ │ ├── weaponcomponent.cpp │ │ └── weaponcomponent.h │ ├── Environment │ │ ├── terrain.cpp │ │ └── terrain.h │ ├── Event.h │ ├── Input │ │ ├── InpMan.cpp │ │ └── inpserv.cpp │ ├── MainLoop │ │ └── Mainloop.cpp │ ├── Module │ │ ├── modman.cpp │ │ └── module.cpp │ ├── Movies │ │ ├── Movies.cpp │ │ ├── Movies.h │ │ ├── Ngps │ │ │ ├── audiodec.cpp │ │ │ ├── audiodec.h │ │ │ ├── defs.h │ │ │ ├── disp.cpp │ │ │ ├── disp.h │ │ │ ├── p_movies.cpp │ │ │ ├── p_movies.h │ │ │ ├── read.cpp │ │ │ ├── readbuf.cpp │ │ │ ├── readbuf.h │ │ │ ├── strfile.cpp │ │ │ ├── strfile.h │ │ │ ├── vibuf.cpp │ │ │ ├── vibuf.h │ │ │ ├── videodec.cpp │ │ │ ├── videodec.h │ │ │ ├── vobuf.cpp │ │ │ └── vobuf.h │ │ ├── Xbox │ │ │ ├── p_movies.cpp │ │ │ └── p_movies.h │ │ └── ngc │ │ │ ├── p_movies.cpp │ │ │ └── p_movies.h │ ├── Music │ │ ├── Ngps │ │ │ ├── Bgm │ │ │ │ ├── PathDefs │ │ │ │ ├── bgm_com.c │ │ │ │ ├── bgm_entr.c │ │ │ │ ├── bgm_i.h │ │ │ │ ├── bgm_play.c │ │ │ │ ├── bgm_r2s.s │ │ │ │ ├── bgm_r2sm.c │ │ │ │ └── makefile │ │ │ ├── Pcm │ │ │ │ ├── Makefile │ │ │ │ ├── PathDefs │ │ │ │ ├── pcm.h │ │ │ │ ├── pcm_com.c │ │ │ │ ├── pcm_ent.c │ │ │ │ ├── pcm_sound.c │ │ │ │ └── pcmiop.h │ │ │ ├── p_music.cpp │ │ │ └── p_music.h │ │ ├── Xbox │ │ │ ├── p_adpcmfilestream.cpp │ │ │ ├── p_adpcmfilestream.h │ │ │ ├── p_music.cpp │ │ │ ├── p_music.h │ │ │ ├── p_soundtrack.cpp │ │ │ ├── p_soundtrack.h │ │ │ ├── p_wmafilestream.cpp │ │ │ └── p_wmafilestream.h │ │ ├── music.cpp │ │ ├── music.h │ │ └── ngc │ │ │ ├── bgm │ │ │ ├── bgm_com.c │ │ │ ├── bgm_entr.c │ │ │ ├── bgm_i.h │ │ │ ├── bgm_play.c │ │ │ ├── bgm_r2s.s │ │ │ └── bgm_r2sm.c │ │ │ ├── divx │ │ │ ├── AUDSimpleAudio.cpp │ │ │ ├── AUDSimpleAudio.h │ │ │ ├── AUDSimplePlayer.cpp │ │ │ └── AUDSimplePlayer.h │ │ │ ├── p_music.cpp │ │ │ ├── p_music.h │ │ │ └── pcm │ │ │ ├── pcm.h │ │ │ ├── pcm_com.c │ │ │ ├── pcm_ent.c │ │ │ └── pcmiop.h │ ├── Net │ │ ├── App │ │ │ └── netapp.cpp │ │ ├── Client │ │ │ ├── netclnt.cpp │ │ │ └── netclnt.h │ │ ├── Dispatch │ │ │ └── netdsptch.cpp │ │ ├── Handler │ │ │ └── nethndlr.cpp │ │ ├── Server │ │ │ ├── netserv.cpp │ │ │ └── netserv.h │ │ ├── net.cpp │ │ ├── net.h │ │ └── netconn.cpp │ ├── ObjPtr.h │ ├── Object │ │ ├── Event.cpp │ │ ├── ObjPtr.cpp │ │ ├── RefCounted.cpp │ │ ├── basecomponent.cpp │ │ ├── basecomponent.h │ │ ├── compositeobject.cpp │ │ ├── compositeobject.h │ │ ├── compositeobjectmanager.cpp │ │ ├── compositeobjectmanager.h │ │ ├── object.cpp │ │ ├── objman.cpp │ │ ├── objsearch.cpp │ │ └── objtrack.cpp │ ├── Prefs │ │ ├── Prefs.cpp │ │ └── Prefs.h │ ├── RefCounted.h │ ├── Scripting │ │ ├── array.cpp │ │ ├── array.h │ │ ├── checksum.cpp │ │ ├── checksum.h │ │ ├── component.cpp │ │ ├── component.h │ │ ├── debugger.cpp │ │ ├── debugger.h │ │ ├── eval.cpp │ │ ├── eval.h │ │ ├── file.cpp │ │ ├── file.h │ │ ├── init.cpp │ │ ├── init.h │ │ ├── parse.cpp │ │ ├── parse.h │ │ ├── script.cpp │ │ ├── script.h │ │ ├── scriptcache.cpp │ │ ├── scriptcache.h │ │ ├── scriptdefs.h │ │ ├── skiptoken.cpp │ │ ├── string.cpp │ │ ├── string.h │ │ ├── struct.cpp │ │ ├── struct.h │ │ ├── symboltable.cpp │ │ ├── symboltable.h │ │ ├── symboltype.cpp │ │ ├── symboltype.h │ │ ├── tokens.cpp │ │ ├── tokens.h │ │ ├── utils.cpp │ │ ├── utils.h │ │ ├── vecpair.cpp │ │ ├── vecpair.h │ │ └── win32functions.cpp │ ├── SoundFX │ │ ├── NGPS │ │ │ ├── p_sfx.cpp │ │ │ └── p_sfx.h │ │ ├── Xbox │ │ │ ├── p_sfx.cpp │ │ │ ├── p_sfx.h │ │ │ └── skate5fx.h │ │ ├── ngc │ │ │ ├── p_sfx.cpp │ │ │ └── p_sfx.h │ │ ├── soundfx.cpp │ │ └── soundfx.h │ ├── inpman.h │ ├── mainloop.h │ ├── modman.h │ ├── module.h │ ├── object.h │ ├── objman.h │ ├── objsearch.h │ ├── objserv.h │ └── objtrack.h ├── Gfx │ ├── 2D │ │ ├── BlurEffect.cpp │ │ ├── BlurEffect.h │ │ ├── Element3d.cpp │ │ ├── Element3d.h │ │ ├── Menu2.cpp │ │ ├── Menu2.h │ │ ├── ScreenElemMan.cpp │ │ ├── ScreenElemMan.h │ │ ├── ScreenElement2.cpp │ │ ├── ScreenElement2.h │ │ ├── ScrollingMenu.cpp │ │ ├── ScrollingMenu.h │ │ ├── SpriteElement.cpp │ │ ├── SpriteElement.h │ │ ├── TextElement.cpp │ │ ├── TextElement.h │ │ ├── Window.cpp │ │ └── Window.h │ ├── AnimController.cpp │ ├── AnimController.h │ ├── BonedAnim.cpp │ ├── BonedAnim.h │ ├── BonedAnimTypes.h │ ├── CasUtils.cpp │ ├── CasUtils.h │ ├── CustomAnimKey.cpp │ ├── CustomAnimKey.h │ ├── FaceMassage.cpp │ ├── FaceMassage.h │ ├── FaceTexture.cpp │ ├── FaceTexture.h │ ├── Image │ │ └── ImageBasic.h │ ├── ModelAppearance.cpp │ ├── ModelAppearance.h │ ├── ModelBuilder.cpp │ ├── ModelBuilder.h │ ├── NGC │ │ ├── NX │ │ │ ├── anim.cpp │ │ │ ├── anim.h │ │ │ ├── chars.cpp │ │ │ ├── chars.h │ │ │ ├── geomnode.cpp │ │ │ ├── geomnode.h │ │ │ ├── grass.cpp │ │ │ ├── grass.h │ │ │ ├── import.cpp │ │ │ ├── import.h │ │ │ ├── instance.cpp │ │ │ ├── instance.h │ │ │ ├── light.cpp │ │ │ ├── light.h │ │ │ ├── line.cpp │ │ │ ├── line.h │ │ │ ├── material.cpp │ │ │ ├── material.h │ │ │ ├── mesh.cpp │ │ │ ├── mesh.h │ │ │ ├── nx_init.cpp │ │ │ ├── nx_init.h │ │ │ ├── occlude.cpp │ │ │ ├── occlude.h │ │ │ ├── particles.cpp │ │ │ ├── particles.h │ │ │ ├── render.cpp │ │ │ ├── render.h │ │ │ ├── scene.cpp │ │ │ ├── scene.h │ │ │ ├── sprite.cpp │ │ │ ├── sprite.h │ │ │ ├── texture.cpp │ │ │ ├── texture.h │ │ │ └── types.h │ │ ├── blur.cpp │ │ ├── p_NxGeom.cpp │ │ ├── p_NxGeom.h │ │ ├── p_NxImposter.cpp │ │ ├── p_NxImposter.h │ │ ├── p_NxLightMan.cpp │ │ ├── p_NxMesh.cpp │ │ ├── p_NxMesh.h │ │ ├── p_NxSprite.cpp │ │ ├── p_NxSprite.h │ │ ├── p_NxTextured3dPoly.cpp │ │ ├── p_NxTextured3dPoly.h │ │ ├── p_NxViewport.cpp │ │ ├── p_NxViewport.h │ │ ├── p_NxWin2D.cpp │ │ ├── p_gfxman.cpp │ │ ├── p_loadscreen.cpp │ │ ├── p_memview.cpp │ │ ├── p_memview.h │ │ ├── p_nx.cpp │ │ ├── p_nxanimcache.cpp │ │ ├── p_nxanimcache.h │ │ ├── p_nxfont.cpp │ │ ├── p_nxfont.h │ │ ├── p_nxfontman.cpp │ │ ├── p_nxlight.cpp │ │ ├── p_nxlight.h │ │ ├── p_nxloadscreen.cpp │ │ ├── p_nxmiscfx.cpp │ │ ├── p_nxmodel.cpp │ │ ├── p_nxmodel.h │ │ ├── p_nxnewparticle.cpp │ │ ├── p_nxnewparticle.h │ │ ├── p_nxnewparticlemgr.cpp │ │ ├── p_nxnewparticlemgr.h │ │ ├── p_nxparticle.cpp │ │ ├── p_nxparticle.h │ │ ├── p_nxparticleflat.cpp │ │ ├── p_nxparticleflat.h │ │ ├── p_nxparticleglow.cpp │ │ ├── p_nxparticleglow.h │ │ ├── p_nxparticleglowribbontrail.cpp │ │ ├── p_nxparticleglowribbontrail.h │ │ ├── p_nxparticleline.cpp │ │ ├── p_nxparticleline.h │ │ ├── p_nxparticleribbon.cpp │ │ ├── p_nxparticleribbon.h │ │ ├── p_nxparticleribbontrail.cpp │ │ ├── p_nxparticleribbontrail.h │ │ ├── p_nxparticleshaded.cpp │ │ ├── p_nxparticleshaded.h │ │ ├── p_nxparticlesmooth.cpp │ │ ├── p_nxparticlesmooth.h │ │ ├── p_nxparticlesmoothribbon.cpp │ │ ├── p_nxparticlesmoothribbon.h │ │ ├── p_nxparticlesmoothstar.cpp │ │ ├── p_nxparticlesmoothstar.h │ │ ├── p_nxparticlestar.cpp │ │ ├── p_nxparticlestar.h │ │ ├── p_nxscene.cpp │ │ ├── p_nxscene.h │ │ ├── p_nxsector.cpp │ │ ├── p_nxsector.h │ │ ├── p_nxtexman.cpp │ │ ├── p_nxtexture.cpp │ │ ├── p_nxtexture.h │ │ ├── p_nxviewman.cpp │ │ ├── p_nxweather.cpp │ │ ├── p_nxweather.h │ │ └── p_nxwin2D.h │ ├── NGPS │ │ ├── NX │ │ │ ├── Makefile │ │ │ ├── asmdma.dsm │ │ │ ├── asmdma.h │ │ │ ├── chars.cpp │ │ │ ├── chars.h │ │ │ ├── dma.cpp │ │ │ ├── dma.h │ │ │ ├── dmacalls.cpp │ │ │ ├── dmacalls.h │ │ │ ├── fx.cpp │ │ │ ├── fx.h │ │ │ ├── geomnode.cpp │ │ │ ├── geomnode.h │ │ │ ├── gif.cpp │ │ │ ├── gif.h │ │ │ ├── group.cpp │ │ │ ├── group.h │ │ │ ├── gs.cpp │ │ │ ├── gs.h │ │ │ ├── immediate.cpp │ │ │ ├── immediate.h │ │ │ ├── instance.cpp │ │ │ ├── instance.h │ │ │ ├── interrupts.cpp │ │ │ ├── interrupts.h │ │ │ ├── light.cpp │ │ │ ├── light.h │ │ │ ├── line.cpp │ │ │ ├── line.h │ │ │ ├── loadscreen.cpp │ │ │ ├── loadscreen.h │ │ │ ├── maintest.cpp │ │ │ ├── material.cpp │ │ │ ├── material.h │ │ │ ├── mesh.cpp │ │ │ ├── mesh.h │ │ │ ├── mikemath.cpp │ │ │ ├── mikemath.h │ │ │ ├── nx_init.cpp │ │ │ ├── nx_init.h │ │ │ ├── occlude.cpp │ │ │ ├── occlude.h │ │ │ ├── pcrtc.cpp │ │ │ ├── pcrtc.h │ │ │ ├── render.cpp │ │ │ ├── render.h │ │ │ ├── resource.cpp │ │ │ ├── resource.h │ │ │ ├── scene.cpp │ │ │ ├── scene.h │ │ │ ├── sprite.cpp │ │ │ ├── sprite.h │ │ │ ├── switches.h │ │ │ ├── texture.cpp │ │ │ ├── texture.h │ │ │ ├── texturemem.cpp │ │ │ ├── texturemem.h │ │ │ ├── types.h │ │ │ ├── vif.cpp │ │ │ ├── vif.h │ │ │ ├── vu0code.dsm │ │ │ ├── vu0code.h │ │ │ ├── vu1.cpp │ │ │ ├── vu1.h │ │ │ ├── vu1 │ │ │ │ ├── defs.vsm │ │ │ │ ├── jumptab.vsm │ │ │ │ ├── main.vsm │ │ │ │ ├── newvu1code.dsm │ │ │ │ ├── newvu1code.h │ │ │ │ └── particle.vsm │ │ │ ├── vu1code.dsm │ │ │ ├── vu1code.h │ │ │ ├── vu1context.cpp │ │ │ └── vu1context.h │ │ ├── PaletteGen.cpp │ │ ├── PaletteGen.h │ │ ├── p_NxAnimCache.cpp │ │ ├── p_NxAnimCache.h │ │ ├── p_NxFont.cpp │ │ ├── p_NxFont.h │ │ ├── p_NxFontMan.cpp │ │ ├── p_NxGeom.cpp │ │ ├── p_NxGeom.h │ │ ├── p_NxImposter.cpp │ │ ├── p_NxImposter.h │ │ ├── p_NxLight.cpp │ │ ├── p_NxLight.h │ │ ├── p_NxLightMan.cpp │ │ ├── p_NxLightMan.h │ │ ├── p_NxLoadScreen.cpp │ │ ├── p_NxMesh.cpp │ │ ├── p_NxMesh.h │ │ ├── p_NxModel.cpp │ │ ├── p_NxModel.h │ │ ├── p_NxScene.cpp │ │ ├── p_NxScene.h │ │ ├── p_NxSector.cpp │ │ ├── p_NxSector.h │ │ ├── p_NxSprite.cpp │ │ ├── p_NxSprite.h │ │ ├── p_NxTexMan.cpp │ │ ├── p_NxTexture.cpp │ │ ├── p_NxTexture.h │ │ ├── p_NxTextured3dPoly.cpp │ │ ├── p_NxTextured3dPoly.h │ │ ├── p_NxViewMan.cpp │ │ ├── p_NxViewport.cpp │ │ ├── p_NxViewport.h │ │ ├── p_NxWin2D.cpp │ │ ├── p_NxWin2D.h │ │ ├── p_gfxman.cpp │ │ ├── p_memview.cpp │ │ ├── p_memview.h │ │ ├── p_nx.cpp │ │ ├── p_nxmiscfx.cpp │ │ ├── p_nxnewparticle.cpp │ │ ├── p_nxnewparticle.h │ │ ├── p_nxnewparticlemgr.cpp │ │ ├── p_nxnewparticlemgr.h │ │ ├── p_nxparticle.cpp │ │ ├── p_nxparticle.h │ │ ├── p_nxparticleflat.cpp │ │ ├── p_nxparticleflat.h │ │ ├── p_nxparticleglow.cpp │ │ ├── p_nxparticleglow.h │ │ ├── p_nxparticleglowribbontrail.cpp │ │ ├── p_nxparticleglowribbontrail.h │ │ ├── p_nxparticleline.cpp │ │ ├── p_nxparticleline.h │ │ ├── p_nxparticlenewflat.cpp │ │ ├── p_nxparticlenewflat.h │ │ ├── p_nxparticleribbon.cpp │ │ ├── p_nxparticleribbon.h │ │ ├── p_nxparticleribbontrail.cpp │ │ ├── p_nxparticleribbontrail.h │ │ ├── p_nxparticleshaded.cpp │ │ ├── p_nxparticleshaded.h │ │ ├── p_nxparticlesmooth.cpp │ │ ├── p_nxparticlesmooth.h │ │ ├── p_nxparticlesmoothribbon.cpp │ │ ├── p_nxparticlesmoothribbon.h │ │ ├── p_nxparticlesmoothstar.cpp │ │ ├── p_nxparticlesmoothstar.h │ │ ├── p_nxparticlestar.cpp │ │ ├── p_nxparticlestar.h │ │ ├── p_nxweather.cpp │ │ └── p_nxweather.h │ ├── NxAnimCache.cpp │ ├── NxAnimCache.h │ ├── NxFont.cpp │ ├── NxFont.h │ ├── NxFontMan.cpp │ ├── NxFontMan.h │ ├── NxGeom.cpp │ ├── NxGeom.h │ ├── NxHierarchy.h │ ├── NxImposter.cpp │ ├── NxImposter.h │ ├── NxLight.cpp │ ├── NxLight.h │ ├── NxLightMan.cpp │ ├── NxLightMan.h │ ├── NxLoadScreen.cpp │ ├── NxLoadScreen.h │ ├── NxMesh.cpp │ ├── NxMesh.h │ ├── NxMiscFX.cpp │ ├── NxMiscFX.h │ ├── NxModel.cpp │ ├── NxModel.h │ ├── NxNewParticle.cpp │ ├── NxNewParticle.h │ ├── NxNewParticleMgr.cpp │ ├── NxNewParticleMgr.h │ ├── NxQuickAnim.cpp │ ├── NxQuickAnim.h │ ├── NxScene.cpp │ ├── NxScene.h │ ├── NxSector.cpp │ ├── NxSector.h │ ├── NxSkinComponent.cpp │ ├── NxSkinComponent.h │ ├── NxSprite.cpp │ ├── NxSprite.h │ ├── NxTexMan.cpp │ ├── NxTexMan.h │ ├── NxTexture.cpp │ ├── NxTexture.h │ ├── NxTextured3dPoly.cpp │ ├── NxTextured3dPoly.h │ ├── NxViewMan.cpp │ ├── NxViewMan.h │ ├── NxViewport.cpp │ ├── NxViewport.h │ ├── NxWin2D.cpp │ ├── NxWin2D.h │ ├── Pose.h │ ├── Skeleton.cpp │ ├── Skeleton.h │ ├── XBox │ │ ├── NX │ │ │ ├── BillboardScreenAlignedVS.vsh │ │ │ ├── ParticleFlatVS.vsh │ │ │ ├── ParticleNewFlatPointSpriteVS.vsh │ │ │ ├── ParticleNewFlatVS.vsh │ │ │ ├── PixelShader0.psh │ │ │ ├── PixelShader0IVA.psh │ │ │ ├── PixelShader1.psh │ │ │ ├── PixelShader2.psh │ │ │ ├── PixelShader3.psh │ │ │ ├── PixelShader4.psh │ │ │ ├── PixelShader5.psh │ │ │ ├── PixelShaderBrighten.psh │ │ │ ├── PixelShaderBrightenIVA.psh │ │ │ ├── PixelShaderBumpWater.psh │ │ │ ├── PixelShaderFocusBlur.psh │ │ │ ├── PixelShaderFocusIntegrate.psh │ │ │ ├── PixelShaderFocusLookupIntegrate.psh │ │ │ ├── PixelShaderNULL.psh │ │ │ ├── PixelShaderPointSprite.psh │ │ │ ├── PixelShader_ShadowBuffer.psh │ │ │ ├── ShadowBufferStaticGeomPS.psh │ │ │ ├── ShadowBufferStaticGeomVS.vsh │ │ │ ├── WeightedMeshVS_1Weight.vsh │ │ │ ├── WeightedMeshVS_2Weight.vsh │ │ │ ├── WeightedMeshVS_3Weight.vsh │ │ │ ├── WeightedMeshVS_VXC_1Weight.vsh │ │ │ ├── WeightedMeshVS_VXC_1Weight_SBPassThru.vsh │ │ │ ├── WeightedMeshVS_VXC_1Weight_UVTransform.vsh │ │ │ ├── WeightedMeshVS_VXC_2Weight.vsh │ │ │ ├── WeightedMeshVS_VXC_2Weight_SBPassThru.vsh │ │ │ ├── WeightedMeshVS_VXC_2Weight_UVTransform.vsh │ │ │ ├── WeightedMeshVS_VXC_3Weight.vsh │ │ │ ├── WeightedMeshVS_VXC_3Weight_SBPassThru.vsh │ │ │ ├── WeightedMeshVS_VXC_3Weight_UVTransform.vsh │ │ │ ├── WeightedMeshVS_VXC_4Weight.vsh │ │ │ ├── WeightedMeshVS_VXC_4Weight_SBPassThru.vsh │ │ │ ├── WeightedMeshVS_VXC_Specular_1Weight.vsh │ │ │ ├── WeightedMeshVS_VXC_Specular_2Weight.vsh │ │ │ ├── WeightedMeshVS_VXC_Specular_3Weight.vsh │ │ │ ├── WeightedMeshVS_VXC_Specular_4Weight.vsh │ │ │ ├── WeightedMeshVertexShader0.vsh │ │ │ ├── WeightedMeshVertexShader1.vsh │ │ │ ├── WeightedMeshVertexShader_SBWrite.vsh │ │ │ ├── anim.cpp │ │ │ ├── anim.h │ │ │ ├── anim_vertdefs.h │ │ │ ├── billboard.cpp │ │ │ ├── billboard.h │ │ │ ├── chars.cpp │ │ │ ├── chars.h │ │ │ ├── gamma.cpp │ │ │ ├── gamma.h │ │ │ ├── grass.cpp │ │ │ ├── grass.h │ │ │ ├── instance.cpp │ │ │ ├── instance.h │ │ │ ├── material.cpp │ │ │ ├── material.h │ │ │ ├── mesh.cpp │ │ │ ├── mesh.h │ │ │ ├── mipmap.inl │ │ │ ├── nx_init.cpp │ │ │ ├── nx_init.h │ │ │ ├── occlude.cpp │ │ │ ├── occlude.h │ │ │ ├── particles.cpp │ │ │ ├── particles.h │ │ │ ├── render.cpp │ │ │ ├── render.h │ │ │ ├── scene.cpp │ │ │ ├── scene.h │ │ │ ├── screenfx.cpp │ │ │ ├── screenfx.h │ │ │ ├── sprite.cpp │ │ │ ├── sprite.h │ │ │ ├── swizzleformat.h │ │ │ ├── texture.cpp │ │ │ ├── texture.h │ │ │ ├── verlet.cpp │ │ │ ├── verlet.h │ │ │ └── xbmemfnt.h │ │ ├── p_NxGeom.cpp │ │ ├── p_NxGeom.h │ │ ├── p_NxImposter.cpp │ │ ├── p_NxImposter.h │ │ ├── p_NxLight.cpp │ │ ├── p_NxLight.h │ │ ├── p_NxLightMan.cpp │ │ ├── p_NxLoadScreen.cpp │ │ ├── p_NxMesh.cpp │ │ ├── p_NxMesh.h │ │ ├── p_NxModel.cpp │ │ ├── p_NxModel.h │ │ ├── p_NxParticleRibbonTrail.cpp │ │ ├── p_NxParticleRibbonTrail.h │ │ ├── p_NxParticleShaded.cpp │ │ ├── p_NxParticleShaded.h │ │ ├── p_NxParticleStar.cpp │ │ ├── p_NxParticleStar.h │ │ ├── p_NxSprite.cpp │ │ ├── p_NxSprite.h │ │ ├── p_NxTextured3dPoly.cpp │ │ ├── p_NxTextured3dPoly.h │ │ ├── p_NxViewMan.cpp │ │ ├── p_NxViewport.cpp │ │ ├── p_NxViewport.h │ │ ├── p_NxWin2D.cpp │ │ ├── p_NxWin2D.h │ │ ├── p_gfxman.cpp │ │ ├── p_loadscreen.cpp │ │ ├── p_memview.cpp │ │ ├── p_memview.h │ │ ├── p_nx.cpp │ │ ├── p_nxfont.cpp │ │ ├── p_nxfont.h │ │ ├── p_nxfontman.cpp │ │ ├── p_nxmiscfx.cpp │ │ ├── p_nxnewparticle.cpp │ │ ├── p_nxnewparticle.h │ │ ├── p_nxnewparticlemgr.cpp │ │ ├── p_nxnewparticlemgr.h │ │ ├── p_nxparticle.cpp │ │ ├── p_nxparticle.h │ │ ├── p_nxparticleflat.cpp │ │ ├── p_nxparticleflat.h │ │ ├── p_nxparticleglow.cpp │ │ ├── p_nxparticleglow.h │ │ ├── p_nxparticleglowribbontrail.cpp │ │ ├── p_nxparticleglowribbontrail.h │ │ ├── p_nxparticleline.cpp │ │ ├── p_nxparticleline.h │ │ ├── p_nxparticleribbon.cpp │ │ ├── p_nxparticleribbon.h │ │ ├── p_nxparticlesmooth.cpp │ │ ├── p_nxparticlesmooth.h │ │ ├── p_nxparticlesmoothribbon.cpp │ │ ├── p_nxparticlesmoothribbon.h │ │ ├── p_nxparticlesmoothstar.cpp │ │ ├── p_nxparticlesmoothstar.h │ │ ├── p_nxscene.cpp │ │ ├── p_nxscene.h │ │ ├── p_nxsector.cpp │ │ ├── p_nxsector.h │ │ ├── p_nxtexman.cpp │ │ ├── p_nxtexture.cpp │ │ ├── p_nxtexture.h │ │ ├── p_nxweather.cpp │ │ └── p_nxweather.h │ ├── baseanimcontroller.cpp │ ├── baseanimcontroller.h │ ├── bbox.cpp │ ├── bbox.h │ ├── blendchannel.cpp │ ├── blendchannel.h │ ├── camera.cpp │ ├── camera.h │ ├── debuggfx.cpp │ ├── debuggfx.h │ ├── gfxman.cpp │ ├── gfxman.h │ ├── gfxutils.cpp │ ├── gfxutils.h │ ├── nx.cpp │ ├── nx.h │ ├── nxflags.h │ ├── nxparticle.cpp │ ├── nxparticle.h │ ├── nxparticlemgr.cpp │ ├── nxparticlemgr.h │ ├── nxweather.cpp │ ├── nxweather.h │ ├── shadow.cpp │ ├── shadow.h │ ├── stdafx.h │ ├── subanimcontroller.cpp │ ├── subanimcontroller.h │ ├── vecfont.cpp │ └── vecfont.h ├── Sk │ ├── .DS_Store │ ├── Components │ │ ├── EditorCameraComponent.cpp │ │ ├── EditorCameraComponent.h │ │ ├── GoalEditorComponent.cpp │ │ ├── GoalEditorComponent.h │ │ ├── ProjectileCollisionComponent.cpp │ │ ├── ProjectileCollisionComponent.h │ │ ├── RailEditorComponent.cpp │ │ ├── RailEditorComponent.h │ │ ├── SkaterAdjustPhysicsComponent.cpp │ │ ├── SkaterAdjustPhysicsComponent.h │ │ ├── SkaterBalanceTrickComponent.cpp │ │ ├── SkaterBalanceTrickComponent.h │ │ ├── SkaterCleanupStateComponent.cpp │ │ ├── SkaterCleanupStateComponent.h │ │ ├── SkaterCorePhysicsComponent.cpp │ │ ├── SkaterCorePhysicsComponent.h │ │ ├── SkaterEndRunComponent.cpp │ │ ├── SkaterEndRunComponent.h │ │ ├── SkaterFinalizePhysicsComponent.cpp │ │ ├── SkaterFinalizePhysicsComponent.h │ │ ├── SkaterFlipAndRotateComponent.cpp │ │ ├── SkaterFlipAndRotateComponent.h │ │ ├── SkaterFloatingNameComponent.cpp │ │ ├── SkaterFloatingNameComponent.h │ │ ├── SkaterGapComponent.cpp │ │ ├── SkaterGapComponent.h │ │ ├── SkaterLocalNetLogicComponent.cpp │ │ ├── SkaterLocalNetLogicComponent.h │ │ ├── SkaterLoopingSoundComponent.cpp │ │ ├── SkaterLoopingSoundComponent.h │ │ ├── SkaterMatrixQueriesComponent.cpp │ │ ├── SkaterMatrixQueriesComponent.h │ │ ├── SkaterNonLocalNetLogicComponent.cpp │ │ ├── SkaterNonLocalNetLogicComponent.h │ │ ├── SkaterPhysicsControlComponent.cpp │ │ ├── SkaterPhysicsControlComponent.h │ │ ├── SkaterProximityComponent.cpp │ │ ├── SkaterProximityComponent.h │ │ ├── SkaterRotateComponent.cpp │ │ ├── SkaterRotateComponent.h │ │ ├── SkaterRunTimerComponent.cpp │ │ ├── SkaterRunTimerComponent.h │ │ ├── SkaterScoreComponent.cpp │ │ ├── SkaterScoreComponent.h │ │ ├── SkaterSoundComponent.cpp │ │ ├── SkaterSoundComponent.h │ │ ├── SkaterStancePanelComponent.cpp │ │ ├── SkaterStancePanelComponent.h │ │ ├── SkaterStateComponent.cpp │ │ ├── SkaterStateComponent.h │ │ ├── SkaterStateHistoryComponent.cpp │ │ └── SkaterStateHistoryComponent.h │ ├── Engine │ │ ├── RectFeeler.cpp │ │ ├── RectFeeler.h │ │ ├── SuperSector.cpp │ │ ├── SuperSector.h │ │ ├── contact.cpp │ │ ├── contact.h │ │ ├── feeler.cpp │ │ ├── feeler.h │ │ ├── sounds.cpp │ │ └── sounds.h │ ├── GameNet │ │ ├── ExportMsg.h │ │ ├── GameHandler.cpp │ │ ├── GameMsg.h │ │ ├── GameNet.cpp │ │ ├── GameNet.h │ │ ├── Lobby.cpp │ │ ├── Lobby.h │ │ ├── Ngps │ │ │ ├── dnas.cpp │ │ │ ├── p_buddy.cpp │ │ │ ├── p_buddy.h │ │ │ ├── p_content.cpp │ │ │ ├── p_content.h │ │ │ ├── p_ezcommon.h │ │ │ ├── p_ezconfig.h │ │ │ ├── p_ezmain.h │ │ │ ├── p_libezcnf.cpp │ │ │ ├── p_libezcnf.h │ │ │ ├── p_netcnfif.h │ │ │ ├── p_netconfig.cpp │ │ │ ├── p_stats.cpp │ │ │ ├── p_stats.h │ │ │ └── snglue.cpp │ │ ├── Player.cpp │ │ ├── ServerList.cpp │ │ ├── XBox │ │ │ ├── p_auth.cpp │ │ │ ├── p_auth.h │ │ │ ├── p_buddy.cpp │ │ │ ├── p_buddy.h │ │ │ ├── p_match.cpp │ │ │ ├── p_match.h │ │ │ ├── p_voice.cpp │ │ │ └── p_voice.h │ │ └── scriptdebugger.h │ ├── Main.cpp │ ├── Modules │ │ ├── FrontEnd │ │ │ ├── FrontEnd.cpp │ │ │ └── FrontEnd.h │ │ ├── Skate │ │ │ ├── BettingGuy.cpp │ │ │ ├── BettingGuy.h │ │ │ ├── CATGoal.cpp │ │ │ ├── CATGoal.h │ │ │ ├── CompetitionGoal.cpp │ │ │ ├── CompetitionGoal.h │ │ │ ├── CreateATrick.cpp │ │ │ ├── CreateATrick.h │ │ │ ├── FilmGoal.cpp │ │ │ ├── FilmGoal.h │ │ │ ├── FindGapsGoal.cpp │ │ │ ├── FindGapsGoal.h │ │ │ ├── GameFlow.cpp │ │ │ ├── GameFlow.h │ │ │ ├── GameMode.cpp │ │ │ ├── GameMode.h │ │ │ ├── Goal.cpp │ │ │ ├── Goal.h │ │ │ ├── GoalManager.cpp │ │ │ ├── GoalManager.h │ │ │ ├── GoalPed.cpp │ │ │ ├── GoalPed.h │ │ │ ├── HorseGoal.cpp │ │ │ ├── HorseGoal.h │ │ │ ├── Minigame.cpp │ │ │ ├── Minigame.h │ │ │ ├── NetGoal.cpp │ │ │ ├── NetGoal.h │ │ │ ├── RaceGoal.cpp │ │ │ ├── RaceGoal.h │ │ │ ├── SkatetrisGoal.cpp │ │ │ ├── SkatetrisGoal.h │ │ │ ├── VictoryCond.cpp │ │ │ ├── VictoryCond.h │ │ │ ├── competition.cpp │ │ │ ├── competition.h │ │ │ ├── horse.cpp │ │ │ ├── horse.h │ │ │ ├── score.cpp │ │ │ ├── score.h │ │ │ ├── skate.cpp │ │ │ ├── skate.h │ │ │ └── skatenet.cpp │ │ └── Viewer │ │ │ ├── Viewer.cpp │ │ │ └── Viewer.h │ ├── Ngps │ │ └── crt0.s │ ├── Objects │ │ ├── FollowOb.h │ │ ├── GameObj.cpp │ │ ├── GameObj.h │ │ ├── MovingObject.cpp │ │ ├── MovingObject.h │ │ ├── PathMan.cpp │ │ ├── PathMan.h │ │ ├── PathOb.cpp │ │ ├── PathOb.h │ │ ├── PlayerProfileManager.cpp │ │ ├── PlayerProfileManager.h │ │ ├── SkaterButton.cpp │ │ ├── SkaterButton.h │ │ ├── SkaterPad.h │ │ ├── SkaterProfile.cpp │ │ ├── SkaterProfile.h │ │ ├── SkaterTricks.cpp │ │ ├── SkaterTricks.h │ │ ├── TrickObject.cpp │ │ ├── TrickObject.h │ │ ├── ViewerObj.cpp │ │ ├── ViewerObj.h │ │ ├── car.cpp │ │ ├── car.h │ │ ├── crown.cpp │ │ ├── crown.h │ │ ├── cutscenedetails.cpp │ │ ├── cutscenedetails.h │ │ ├── emitter.cpp │ │ ├── emitter.h │ │ ├── followob.cpp │ │ ├── gap.cpp │ │ ├── gap.h │ │ ├── manual.cpp │ │ ├── manual.h │ │ ├── moviecam.cpp │ │ ├── moviecam.h │ │ ├── moviedetails.cpp │ │ ├── moviedetails.h │ │ ├── navigation.cpp │ │ ├── navigation.h │ │ ├── objecthook.cpp │ │ ├── objecthook.h │ │ ├── ped.cpp │ │ ├── ped.h │ │ ├── proxim.cpp │ │ ├── proxim.h │ │ ├── rail.cpp │ │ ├── rail.h │ │ ├── records.cpp │ │ ├── records.h │ │ ├── restart.cpp │ │ ├── restart.h │ │ ├── skater.cpp │ │ ├── skater.h │ │ ├── skatercam.cpp │ │ ├── skatercam.h │ │ ├── skatercareer.cpp │ │ ├── skatercareer.h │ │ ├── skaterflags.h │ │ └── skaterpad.cpp │ ├── ParkEditor │ │ ├── EdRail.cpp │ │ ├── EdRail.h │ │ └── LoadPath.txt │ ├── ParkEditor2 │ │ ├── EdMap.cpp │ │ ├── EdMap.h │ │ ├── GapManager.cpp │ │ ├── GapManager.h │ │ ├── ParkEd.cpp │ │ ├── ParkEd.h │ │ ├── ParkGen.cpp │ │ ├── ParkGen.h │ │ ├── clipboard.cpp │ │ └── clipboard.h │ ├── Scripting │ │ ├── cfuncs.cpp │ │ ├── cfuncs.h │ │ ├── ftables.cpp │ │ ├── ftables.h │ │ ├── gs_file.cpp │ │ ├── gs_file.h │ │ ├── gs_init.cpp │ │ ├── gs_init.h │ │ ├── mcfuncs.cpp │ │ ├── mcfuncs.h │ │ ├── nodearray.cpp │ │ ├── nodearray.h │ │ ├── skfuncs.cpp │ │ └── skfuncs.h │ ├── heap_sizes.h │ ├── language.h │ ├── ngc │ │ ├── crt0.s │ │ └── defs.s │ ├── product_codes.h │ └── template.h ├── Sys │ ├── Config │ │ ├── NGC │ │ │ └── p_config.cpp │ │ ├── NGPS │ │ │ └── p_config.cpp │ │ ├── Win32 │ │ │ └── p_config.cpp │ │ ├── XBox │ │ │ └── p_config.cpp │ │ ├── config.cpp │ │ └── config.h │ ├── File │ │ ├── AsyncFilesys.cpp │ │ ├── AsyncFilesys.h │ │ ├── AsyncTypes.h │ │ ├── FileLibrary.cpp │ │ ├── FileLibrary.h │ │ ├── PRE.cpp │ │ ├── PRE.h │ │ ├── XBox │ │ │ ├── hed.cpp │ │ │ ├── hed.h │ │ │ ├── p_AsyncFilesys.cpp │ │ │ ├── p_AsyncFilesys.h │ │ │ ├── p_filesys.cpp │ │ │ ├── p_pre.cpp │ │ │ ├── p_streamer.cpp │ │ │ └── p_streamer.h │ │ ├── filesys.h │ │ ├── memfile.h │ │ ├── ngc │ │ │ ├── hed.cpp │ │ │ ├── hed.h │ │ │ ├── p_AsyncFilesys.cpp │ │ │ ├── p_asyncFilesys.h │ │ │ ├── p_filesys.cpp │ │ │ └── p_pre.cpp │ │ ├── ngps │ │ │ ├── FileIO │ │ │ │ ├── FIleIO_IOP.h │ │ │ │ ├── FileIO.h │ │ │ │ ├── Makefile │ │ │ │ ├── PathDefs │ │ │ │ ├── command.c │ │ │ │ └── start.c │ │ │ ├── hed.cpp │ │ │ ├── hed.h │ │ │ ├── p_AsyncFilesys.cpp │ │ │ ├── p_AsyncFilesys.h │ │ │ └── p_filesys.cpp │ │ ├── pip.cpp │ │ └── pip.h │ ├── McMan.h │ ├── Mem │ │ ├── CompactPool.cpp │ │ ├── CompactPool.h │ │ ├── PoolManager.cpp │ │ ├── PoolManager.h │ │ ├── Poolable.cpp │ │ ├── Poolable.h │ │ ├── alloc.cpp │ │ ├── alloc.h │ │ ├── handle.h │ │ ├── heap.cpp │ │ ├── heap.h │ │ ├── memdbg.h │ │ ├── memman.cpp │ │ ├── memman.h │ │ ├── memptr.h │ │ ├── memtest.cpp │ │ ├── memtest.h │ │ ├── pile.cpp │ │ ├── pile.h │ │ ├── pool.cpp │ │ ├── pool.h │ │ ├── region.cpp │ │ └── region.h │ ├── MemCard │ │ ├── NGPS │ │ │ └── p_McMan.cpp │ │ ├── XBox │ │ │ └── p_McMan.cpp │ │ └── ngc │ │ │ └── p_McMan.cpp │ ├── Profiler.cpp │ ├── Profiler.h │ ├── Replay │ │ ├── NGC │ │ │ └── p_replay.cpp │ │ ├── NGPS │ │ │ └── p_replay.cpp │ │ ├── Win32 │ │ │ └── p_replay.cpp │ │ ├── XBox │ │ │ └── p_replay.cpp │ │ ├── replay.cpp │ │ └── replay.h │ ├── SIO │ │ ├── NGPS │ │ │ └── p_keyboard.cpp │ │ ├── XBox │ │ │ ├── p_keyboard.cpp │ │ │ ├── p_siodev.cpp │ │ │ └── p_sioman.cpp │ │ ├── keyboard.h │ │ ├── ngc │ │ │ ├── p_keyboard.cpp │ │ │ ├── siodev.cpp │ │ │ └── sioman.cpp │ │ ├── siodev.cpp │ │ └── sioman.cpp │ ├── Win32 │ │ └── p_timer.cpp │ ├── XBox │ │ └── p_timer.cpp │ ├── demo.cpp │ ├── demo.h │ ├── ngc │ │ ├── p_anim.cpp │ │ ├── p_anim.h │ │ ├── p_anim_core.s │ │ ├── p_aram.cpp │ │ ├── p_aram.h │ │ ├── p_assert.h │ │ ├── p_atomic.cpp │ │ ├── p_atomic.h │ │ ├── p_bbox.cpp │ │ ├── p_bbox.h │ │ ├── p_buffer.cpp │ │ ├── p_buffer.h │ │ ├── p_camera.cpp │ │ ├── p_camera.h │ │ ├── p_clump.cpp │ │ ├── p_clump.h │ │ ├── p_collision.cpp │ │ ├── p_collision.h │ │ ├── p_debugfont.cpp │ │ ├── p_debugfont.h │ │ ├── p_display.cpp │ │ ├── p_display.h │ │ ├── p_dl.cpp │ │ ├── p_dl.h │ │ ├── p_dlman.cpp │ │ ├── p_dlman.h │ │ ├── p_dma.cpp │ │ ├── p_dma.h │ │ ├── p_dvd.cpp │ │ ├── p_dvd.h │ │ ├── p_file.cpp │ │ ├── p_file.h │ │ ├── p_font.cpp │ │ ├── p_frame.cpp │ │ ├── p_frame.h │ │ ├── p_gx.cpp │ │ ├── p_gx.h │ │ ├── p_hashid.cpp │ │ ├── p_hashid.h │ │ ├── p_hw.h │ │ ├── p_hwinit.cpp │ │ ├── p_hwpad.cpp │ │ ├── p_hwpad.h │ │ ├── p_light.cpp │ │ ├── p_light.h │ │ ├── p_material.cpp │ │ ├── p_material.h │ │ ├── p_matman.cpp │ │ ├── p_matman.h │ │ ├── p_matrix.cpp │ │ ├── p_matrix.h │ │ ├── p_model.cpp │ │ ├── p_model.h │ │ ├── p_particle.cpp │ │ ├── p_particle.h │ │ ├── p_ppcwgpipe.h │ │ ├── p_prim.cpp │ │ ├── p_prim.h │ │ ├── p_profile.cpp │ │ ├── p_profile.h │ │ ├── p_quat.cpp │ │ ├── p_quat.h │ │ ├── p_reftypes.h │ │ ├── p_render.cpp │ │ ├── p_render.h │ │ ├── p_scene.cpp │ │ ├── p_scene.h │ │ ├── p_screenshot.cpp │ │ ├── p_screenshot.h │ │ ├── p_slerp.cpp │ │ ├── p_slerp.h │ │ ├── p_tex.cpp │ │ ├── p_tex.h │ │ ├── p_texman.cpp │ │ ├── p_texman.h │ │ ├── p_timer.cpp │ │ ├── p_triangle.cpp │ │ ├── p_triangle.h │ │ ├── p_vector.cpp │ │ └── p_vector.h │ ├── ngps │ │ └── p_timer.cpp │ ├── siodev.h │ ├── sioman.h │ ├── sys.cpp │ ├── sys.h │ ├── timer.cpp │ └── timer.h ├── standard.cpp ├── template.cpp └── template.h └── README.md /Code/Core/Math/matrix.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Core/Math/matrix.cpp -------------------------------------------------------------------------------- /Code/Core/Math/matrix.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Core/Math/matrix.inl -------------------------------------------------------------------------------- /Code/Core/Math/rot90.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////// 2 | // rot90.h 3 | // 4 | 5 | #ifndef __CORE_ROT90_H 6 | #define __CORE_ROT90_H 7 | 8 | namespace Mth 9 | { 10 | 11 | // Rotation values for 90 degree increment Rotation (uses no multiplication) 12 | enum ERot90 { 13 | ROT_0 = 0, 14 | ROT_90, 15 | ROT_180, 16 | ROT_270, 17 | NUM_ROTS 18 | }; 19 | 20 | // Integer rotate 21 | void RotateY90( ERot90 angle, int32& x, int32& y, int32& z ); 22 | 23 | } 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Code/Core/Thread/ngps/t_thread.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | * 3 | * DESCRIPTION: thread/ngps/t_thread.cpp 4 | * 5 | * AUTHOR: JAB 6 | * 7 | * HISTORY: 8 | * 9 | * DATE:9/1/2000 10 | * 11 | *******************************************************************/ 12 | 13 | /** include files **/ 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include "t_thread.h" 20 | 21 | extern "C" int _std_stack[8]; 22 | static int* _stack = _std_stack; 23 | 24 | extern "C" int _stack_size[8]; 25 | extern "C" int _start(void); 26 | 27 | Thread::PerThreadStruct _rootThreadStruct = 28 | { 29 | "ROOT", 30 | 0, 31 | 0, 32 | _start, // m_pEntry 33 | _stack, // m_pStackBase 34 | (int)_stack_size, // m_iStackSize 35 | 0, 36 | 0 37 | }; 38 | 39 | int Thread::dummy = -1; 40 | 41 | 42 | 43 | typedef void (*VOID_CB)(void*); // pointer to function that takes a void pointer 44 | 45 | 46 | 47 | namespace Thread 48 | { 49 | 50 | 51 | 52 | HTHREAD CreateThread( PerThreadStruct* pPTS ) 53 | { 54 | 55 | ThreadParam sParam; 56 | /*sParam.entry = pPTS->m_pEntry;*/ 57 | sParam.entry = (VOID_CB) (pPTS->m_pEntry); 58 | sParam.stack = pPTS->m_pStackBase; 59 | sParam.stackSize = pPTS->m_iStackSize; 60 | //ps2memset( pPTS->m_pStackBase, 0xca, pPTS->m_iStackSize); 61 | sParam.initPriority = pPTS->m_iInitialPriority; 62 | sParam.gpReg = &_gp; 63 | #ifdef __THREAD_DEBUGGING_PRINTS__ 64 | Dbg_Message( "T::CrThread: %s, entry 0x%x, stack 0x%x, size 0x%x\n",pPTS->m_cID, (unsigned int) pPTS->m_pEntry, (unsigned int) pPTS->m_pStackBase, (unsigned int) pPTS->m_iStackSize ); 65 | #endif 66 | pPTS->m_osId = ::CreateThread( &sParam ); 67 | return (HTHREAD) pPTS; 68 | } 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /Code/Core/Thread/wn32/t_thread.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | * 3 | * DESCRIPTION: t_target.h 4 | * 5 | * AUTHOR: JAB 6 | * 7 | * HISTORY: 8 | * 9 | * DATE:9/5/2000 10 | * 11 | 12 | This is a dummy file, because its in the NGPS version 13 | it has to be here too. 14 | 15 | *******************************************************************/ 16 | 17 | /** include files **/ 18 | 19 | /** local definitions **/ 20 | 21 | /* default settings */ 22 | 23 | /** external functions **/ 24 | 25 | /** external data **/ 26 | 27 | /** internal functions **/ 28 | 29 | /** public data **/ 30 | 31 | /** private data **/ 32 | 33 | /** public functions **/ 34 | 35 | /** private functions **/ 36 | 37 | -------------------------------------------------------------------------------- /Code/Core/Thread/wn32/t_thread.h: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | * 3 | * DESCRIPTION: t_target.h 4 | * 5 | * AUTHOR: JAB 6 | * 7 | * HISTORY: 8 | * 9 | * DATE:9/5/2000 10 | * 11 | 12 | This is a dummy file, because its in the NGPS version 13 | it has to be here too. 14 | 15 | *******************************************************************/ 16 | 17 | /** include files **/ 18 | 19 | /** local definitions **/ 20 | 21 | /* default settings */ 22 | 23 | /** external functions **/ 24 | 25 | /** external data **/ 26 | 27 | /** internal functions **/ 28 | 29 | /** public data **/ 30 | 31 | /** private data **/ 32 | 33 | /** public functions **/ 34 | 35 | /** private functions **/ 36 | 37 | -------------------------------------------------------------------------------- /Code/Core/compress.h: -------------------------------------------------------------------------------- 1 | #ifndef __CORE_COMPRESS_H 2 | #define __CORE_COMPRESS_H 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | int Encode(char *pIn, char *pOut, int bytes_to_read, bool print_progress); 9 | unsigned char *DecodeLZSS(unsigned char *pIn, unsigned char *pOut, int Len); 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Code/Core/glue.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLUE_H__ 2 | #define __GLUE_H__ 3 | 4 | 5 | #endif // __GLUE_H__ 6 | -------------------------------------------------------------------------------- /Code/Core/log.h: -------------------------------------------------------------------------------- 1 | #ifndef __CORE_DEBUG_LOG_H 2 | #define __CORE_DEBUG_LOG_H 3 | 4 | namespace Log 5 | { 6 | void Init(); 7 | void AddEntry(char *p_fileName, int lineNumber, char *p_functionName, char *p_message=NULL); 8 | } 9 | 10 | #endif // #ifndef __CORE_DEBUG_LOG_H 11 | 12 | -------------------------------------------------------------------------------- /Code/Core/support.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | ** ** 3 | ** Neversoft Entertainment ** 4 | ** ** 5 | ** Copyright (C) 1999 - All Rights Reserved ** 6 | ** ** 7 | ****************************************************************************** 8 | ** ** 9 | ** Project: Core Library ** 10 | ** ** 11 | ** Module: Support (SPT) ** 12 | ** ** 13 | ** File name: core/support.h ** 14 | ** ** 15 | ** Created: 05/27/99 - mjb ** 16 | ** ** 17 | *****************************************************************************/ 18 | 19 | #ifndef __CORE_SUPPORT_H 20 | #define __CORE_SUPPORT_H 21 | 22 | /***************************************************************************** 23 | ** Includes ** 24 | *****************************************************************************/ 25 | 26 | #include 27 | #include 28 | #include "sk/language.h" 29 | 30 | /***************************************************************************** 31 | ** Defines ** 32 | *****************************************************************************/ 33 | 34 | // #define PAL for PAL mode build. 35 | #define PALx 36 | 37 | 38 | #endif // __CORE_TASK_H 39 | 40 | 41 | -------------------------------------------------------------------------------- /Code/Core/thread.h: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | * 3 | * DESCRIPTION: thread.h 4 | * 5 | * AUTHOR: JAB 6 | * 7 | * HISTORY: 8 | * 9 | * DATE:9/1/2000 10 | * 11 | *******************************************************************/ 12 | 13 | /** include files **/ 14 | #ifndef __CORE_DEFINES_H 15 | #include 16 | #endif 17 | 18 | #ifdef __PLAT_WN32__ 19 | #else 20 | # ifdef __PLAT_XBOX__ 21 | # else 22 | # ifdef __PLAT_NGPS__ 23 | # include "thread/ngps/t_thread.h" 24 | # elif defined( __PLAT_NGC__ ) 25 | # include "thread/ngc/t_thread.h" 26 | # else 27 | # error Unsupported Platform 28 | # endif 29 | # endif 30 | #endif 31 | 32 | 33 | -------------------------------------------------------------------------------- /Code/Gel/AssMan/NodeArrayAsset.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // animasset.h - interface between asset manager, and the actual animation 3 | // provides a common interface to the 4 | #ifndef __GEL_NODEARRAYASSET_H__ 5 | #define __GEL_NODEARRAYASSET_H__ 6 | 7 | #ifndef __CORE_DEFINES_H 8 | #include 9 | #endif 10 | 11 | #include 12 | 13 | namespace Ass 14 | { 15 | 16 | class CNodeArrayAsset : public CAsset 17 | { 18 | 19 | public: 20 | virtual int Load( const char *p_file, bool async_load, bool use_pip, void* pExtraData, Script::CStruct *pStruct ); // create or load the asset 21 | virtual int Unload(); // Unload the asset 22 | virtual int Reload( const char *p_file); 23 | virtual bool LoadFinished(); // Check to make sure asset is actually there 24 | virtual const char * Name(); // printable name, for debugging 25 | virtual EAssetType GetType(); // type is hard wired into asset class 26 | private: 27 | 28 | 29 | uint32 m_qb_checksum; 30 | }; 31 | 32 | 33 | } // end namespace Ass 34 | 35 | #endif // #ifndef __GEL_ASSET_H__ 36 | 37 | -------------------------------------------------------------------------------- /Code/Gel/AssMan/animasset.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // animasset.h - interface between asset manager, and the actual animation 3 | // provides a common interface to the 4 | #ifndef __GEL_ANIMASSET_H__ 5 | #define __GEL_ANIMASSET_H__ 6 | 7 | 8 | 9 | #ifndef __CORE_DEFINES_H 10 | #include 11 | #endif 12 | 13 | #include 14 | 15 | namespace Ass 16 | { 17 | 18 | 19 | 20 | class CAnimAsset : public CAsset 21 | { 22 | 23 | public: 24 | virtual int Load(const char *p_file, bool async_load, bool use_pip, void* pExtraData, Script::CStruct *pStruct); // create or load the asset 25 | virtual int Load(uint32* p_data, int data_size); // create or load the asset 26 | virtual int Unload(); // Unload the asset 27 | virtual int Reload(const char *p_file); 28 | virtual bool LoadFinished(); // Check to make sure asset is actually there 29 | virtual const char * Name(); // printable name, for debugging 30 | virtual EAssetType GetType(); // type is hard wired into asset class 31 | private: 32 | 33 | 34 | }; 35 | 36 | 37 | } // end namespace Ass 38 | 39 | #endif // #ifndef __GEL_ASSET_H__ 40 | 41 | -------------------------------------------------------------------------------- /Code/Gel/AssMan/asset.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gel/AssMan/asset.h -------------------------------------------------------------------------------- /Code/Gel/AssMan/assettypes.h: -------------------------------------------------------------------------------- 1 | // asset types for the asset manager 2 | 3 | #ifndef __GEL_ASSETTYPES_H 4 | #define __GEL_ASSETTYPES_H 5 | 6 | namespace Ass 7 | { 8 | 9 | enum EAssetType { 10 | ASSET_UNKNOWN, // unknown, needs to be determined by inspection 11 | ASSET_BINARY, // binary file 12 | ASSET_SCENE, // world_geometry 13 | ASSET_TEXTURES, // Texture file 14 | ASSET_COLLISION, // collision file 15 | ASSET_ANIM, // animation 16 | ASSET_SKELETON, // skeleton 17 | ASSET_SKIN, // skin 18 | ASSET_CUTSCENE, // cutscene 19 | ASSET_NODEARRAY, // model node array 20 | }; 21 | 22 | } // namespace Ass 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Code/Gel/AssMan/refasset.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gel/AssMan/refasset.cpp -------------------------------------------------------------------------------- /Code/Gel/AssMan/refasset.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gel/AssMan/refasset.h -------------------------------------------------------------------------------- /Code/Gel/AssMan/skinasset.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // skinasset.h - interface between asset manager, and the actual skin 3 | // provides a common interface to the asset manager 4 | #ifndef __GEL_SKINASSET_H__ 5 | #define __GEL_SKINASSET_H__ 6 | 7 | 8 | 9 | #ifndef __CORE_DEFINES_H 10 | #include 11 | #endif 12 | 13 | #include 14 | 15 | namespace Ass 16 | { 17 | 18 | struct SCutsceneModelDataInfo 19 | { 20 | uint32 modelChecksum; 21 | uint32* pModelData; 22 | int modelDataSize; 23 | uint32* pTextureData; 24 | int textureDataSize; 25 | uint8* pCASData; 26 | uint32 texDictChecksum; 27 | int texDictOffset; 28 | bool isSkin; 29 | bool doShadowVolume; 30 | }; 31 | 32 | struct SSkinAssetLoadContext 33 | { 34 | int forceTexDictLookup; 35 | bool doShadowVolume; 36 | int texDictOffset; 37 | }; 38 | 39 | class CSkinAsset : public CAsset 40 | { 41 | 42 | public: 43 | virtual int Load(const char *p_file, bool async_load, bool use_pip, void* pExtraData, Script::CStruct *pStruct); // create or load the asset 44 | virtual int Load(uint32* p_data, int data_size); // create or load the asset 45 | virtual int Unload(); // Unload the asset 46 | virtual int Reload(const char *p_file); 47 | virtual bool LoadFinished(); // Check to make sure asset is actually there 48 | virtual const char * Name(); // printable name, for debugging 49 | virtual EAssetType GetType(); // type is hard wired into asset class 50 | private: 51 | 52 | 53 | }; 54 | 55 | 56 | } // end namespace Ass 57 | 58 | #endif // #ifndef __GEL_SKINASSET_H__ 59 | 60 | -------------------------------------------------------------------------------- /Code/Gel/Collision/CollEnums.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | ** ** 3 | ** Neversoft Entertainment ** 4 | ** ** 5 | ** Copyright (C) 2002 - All Rights Reserved ** 6 | ** ** 7 | ****************************************************************************** 8 | ** ** 9 | ** Project: PS2 ** 10 | ** ** 11 | ** Module: Nx ** 12 | ** ** 13 | ** File name: CollEnums.h ** 14 | ** ** 15 | ** Created: 02/27/2002 - grj ** 16 | ** ** 17 | *****************************************************************************/ 18 | 19 | #ifndef __GEL_COLLENUMS_H 20 | #define __GEL_COLLENUMS_H 21 | 22 | namespace Nx 23 | { 24 | 25 | /***************************************************************************** 26 | ** Defines ** 27 | *****************************************************************************/ 28 | 29 | //////////////////////////////////////////////////////////////// 30 | // Types of collision 31 | enum CollType 32 | { 33 | vCOLL_TYPE_NONE = 0, 34 | vCOLL_TYPE_BBOX, 35 | vCOLL_TYPE_SPHERE, 36 | vCOLL_TYPE_CYLINDRICAL, 37 | vCOLL_TYPE_GEOM, 38 | }; 39 | 40 | // Typedefs 41 | typedef uint16 FaceIndex; 42 | typedef uint8 FaceByteIndex; 43 | 44 | } // namespace Nx 45 | 46 | #endif // __GEL_COLLENUMS_H 47 | -------------------------------------------------------------------------------- /Code/Gel/Components/CameraUtil.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gel/Components 3 | //* FILENAME: CameraUtil.cpp 4 | //* OWNER: Dan 5 | //* CREATION DATE: 4/10/3 6 | //**************************************************************************** 7 | 8 | #ifndef __COMPONENTS_CAMERAUTIL_H__ 9 | #define __COMPONENTS_CAMERAUTIL_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #define SKATERCAMERACOMPONENT_PERFECT_ABOVE (3.0f) 16 | 17 | #if 0 18 | // Ignore faces that are NOT flagged as camera collidable 19 | #define IGNORE_FACE_FLAGS_1 (0) 20 | #define IGNORE_FACE_FLAGS_0 (mFD_CAMERA_COLLIDABLE) 21 | #endif 22 | 23 | #if 0 24 | // ignore faces that ARE flagged as camera collidable 25 | #define IGNORE_FACE_FLAGS_1 (0) 26 | #define IGNORE_FACE_FLAGS_0 (mFD_CAMERA_COLLIDABLE) 27 | #endif 28 | 29 | #if 1 30 | // ignore faces that are non-collidable or invisible 31 | //#define IGNORE_FACE_FLAGS_1 (mFD_NON_COLLIDABLE | mFD_INVISIBLE) 32 | #define IGNORE_FACE_FLAGS_1 (mFD_NON_COLLIDABLE | mFD_CAMERA_COLLIDABLE) 33 | #define IGNORE_FACE_FLAGS_0 (0) 34 | #endif 35 | 36 | # define CAMERA_SLERP_STOP 0.9999f 37 | 38 | namespace Obj 39 | { 40 | float GetTimeAdjustedSlerp ( float slerp, float delta ); 41 | void ApplyCameraCollisionDetection ( Mth::Vector& camera_pos, Mth::Matrix& camera_matrix, const Mth::Vector& target_pos, const Mth::Vector& forcus_pos, bool side_feelers = true, bool refocus = true ); 42 | 43 | struct SCameraState 44 | { 45 | Mth::Matrix lastActualMatrix; 46 | Mth::Vector lastTripodPos; 47 | float lastDot; 48 | float lastZoom; 49 | }; 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Code/Gel/Components/ModelLightUpdateComponent.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gel/Components 3 | //* FILENAME: ModelLightUpdateComponent.h 4 | //* OWNER: Garrett 5 | //* CREATION DATE: 07/10/03 6 | //**************************************************************************** 7 | 8 | #ifndef __COMPONENTS_MODELLIGHTUPDATECOMPONENT_H__ 9 | #define __COMPONENTS_MODELLIGHTUPDATECOMPONENT_H__ 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #define CRC_MODELLIGHTUPDATE CRCD(0xe3fca939,"ModelLightUpdate") 17 | #define GetModelLightUpdateComponent() ((Obj::CModelLightUpdateComponent*)GetComponent(CRC_MODELLIGHTUPDATE)) 18 | #define GetModelLightUpdateComponentFromObject(pObj) ((Obj::CModelLightUpdateComponent*)(pObj)->GetComponent(CRC_MODELLIGHTUPDATE)) 19 | 20 | namespace Script 21 | { 22 | class CScript; 23 | class CStruct; 24 | } 25 | 26 | namespace Obj 27 | { 28 | 29 | class CModelComponent; 30 | 31 | class CModelLightUpdateComponent : public CBaseComponent 32 | { 33 | public: 34 | CModelLightUpdateComponent(); 35 | virtual ~CModelLightUpdateComponent(); 36 | 37 | public: 38 | virtual void Update(); 39 | virtual void InitFromStructure( Script::CStruct* pParams ); 40 | virtual void Finalize(); 41 | virtual void RefreshFromStructure( Script::CStruct* pParams ); 42 | 43 | virtual EMemberFunctionResult CallMemberFunction( uint32 Checksum, Script::CStruct* pParams, Script::CScript* pScript ); 44 | virtual void GetDebugInfo( Script::CStruct* p_info ); 45 | 46 | static CBaseComponent* s_create(); 47 | 48 | protected: 49 | CModelComponent * mp_model_component; 50 | }; 51 | 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Code/Gel/Components/SetDisplayMatrixComponent.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gel/Components 3 | //* FILENAME: SetDisplayMatrixComponent.h 4 | //* OWNER: Dan 5 | //* CREATION DATE: 8/6/3 6 | //**************************************************************************** 7 | 8 | #ifndef __COMPONENTS_SETDISPLAYMATRIXCOMPONENT_H__ 9 | #define __COMPONENTS_SETDISPLAYMATRIXCOMPONENT_H__ 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #define CRC_SETDISPLAYMATRIX CRCD(0x1bbf844d,"SetDisplayMatrix") 17 | 18 | #define GetSetDisplayMatrixComponent() ((Obj::CSetDisplayMatrixComponent*)GetComponent(CRC_SETDISPLAYMATRIX)) 19 | #define GetSetDisplayMatrixComponentFromObject(pObj) ((Obj::CSetDisplayMatrixComponent*)(pObj)->GetComponent(CRC_SETDISPLAYMATRIX)) 20 | 21 | namespace Script 22 | { 23 | class CScript; 24 | class CStruct; 25 | } 26 | 27 | namespace Obj 28 | { 29 | 30 | class CSetDisplayMatrixComponent : public CBaseComponent 31 | { 32 | public: 33 | CSetDisplayMatrixComponent(); 34 | virtual ~CSetDisplayMatrixComponent(); 35 | 36 | public: 37 | virtual void InitFromStructure( Script::CStruct* pParams ); 38 | virtual void RefreshFromStructure( Script::CStruct* pParams ); 39 | virtual void Update(); 40 | 41 | virtual EMemberFunctionResult CallMemberFunction( uint32 Checksum, Script::CStruct* pParams, Script::CScript* pScript ); 42 | virtual void GetDebugInfo( Script::CStruct* p_info ); 43 | 44 | static CBaseComponent* s_create(); 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Code/Gel/Components/emptycomponent.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gel/Components 3 | //* FILENAME: EmptyComponent.h 4 | //* OWNER: ??? 5 | //* CREATION DATE: ??/??/?? 6 | //**************************************************************************** 7 | 8 | #ifndef __COMPONENTS_EMPTYCOMPONENT_H__ 9 | #define __COMPONENTS_EMPTYCOMPONENT_H__ 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | // Replace this with the CRCD of the component you are adding 17 | #define CRC_EMPTY CRCD(0x9738c23b,"Empty") 18 | 19 | // Standard accessor macros for getting the component either from within an object, or 20 | // given an object 21 | #define GetEmptyComponent() ((Obj::CEmptyComponent*)GetComponent(CRC_EMPTY)) 22 | #define GetEmptyComponentFromObject(pObj) ((Obj::CEmptyComponent*)(pObj)->GetComponent(CRC_EMPTY)) 23 | 24 | namespace Script 25 | { 26 | class CScript; 27 | class CStruct; 28 | } 29 | 30 | namespace Obj 31 | { 32 | 33 | class CEmptyComponent : public CBaseComponent 34 | { 35 | public: 36 | CEmptyComponent(); 37 | virtual ~CEmptyComponent(); 38 | 39 | public: 40 | virtual void Update(); 41 | virtual void InitFromStructure( Script::CStruct* pParams ); 42 | // virtual void Finalize(); 43 | virtual void RefreshFromStructure( Script::CStruct* pParams ); 44 | 45 | virtual EMemberFunctionResult CallMemberFunction( uint32 Checksum, Script::CStruct* pParams, Script::CScript* pScript ); 46 | virtual void GetDebugInfo( Script::CStruct* p_info ); 47 | 48 | static CBaseComponent* s_create(); 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Code/Gel/Movies/Movies.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | ** ** 3 | ** Neversoft Entertainment ** 4 | ** ** 5 | ** Copyright (C) 1999 - All Rights Reserved ** 6 | ** ** 7 | ****************************************************************************** 8 | ** ** 9 | ** Project: GEL (Game Engine Library) ** 10 | ** ** 11 | ** Module: movies ** 12 | ** ** 13 | ** File name: gel/movies/movies.h ** 14 | ** ** 15 | ** Created: 5/14/01 - mjd ** 16 | ** ** 17 | *****************************************************************************/ 18 | 19 | #ifndef __GEL_MOVIES_H 20 | #define __GEL_MOVIES_H 21 | 22 | /***************************************************************************** 23 | ** Includes ** 24 | *****************************************************************************/ 25 | 26 | #include 27 | #include 28 | //#include 29 | 30 | /***************************************************************************** 31 | ** Defines ** 32 | *****************************************************************************/ 33 | 34 | namespace Flx 35 | { 36 | 37 | 38 | 39 | void PlayMovie( const char *pMovieName ); 40 | 41 | } // namespace Flx 42 | 43 | #endif // __GEL_MOVIES_H 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Code/Gel/Movies/Ngps/defs.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEFS_H_ 2 | #define _DEFS_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #ifndef __CORE_DEFINES_H 9 | #include 10 | #endif 11 | #include 12 | #include 13 | 14 | #define STRFILE_NUM_STREAMING_SECTORS 80 15 | 16 | #define UNCMASK 0x0fffffff 17 | #define UNCBASE 0x20000000 18 | 19 | #define MAX_WIDTH 720 20 | #define MAX_HEIGHT 576 21 | 22 | #define MOVIE_THREAD_PRIORITY 1 23 | #define AUTODMA_CH 0 24 | 25 | #define N_LDTAGS (MAX_WIDTH/16 * MAX_HEIGHT/16 * 6 + 10) 26 | #define TS_NONE (-1) 27 | 28 | #define bound(val, x) ((((val) + (x) - 1) / (x))*(x)) 29 | #define min(x, y) (((x) > (y))? (y): (x)) 30 | #define max(x, y) (((x) < (y))? (y): (x)) 31 | 32 | extern inline void *DmaAddr(void *val) 33 | { 34 | return (void*)((u_int)val & UNCMASK); 35 | } 36 | 37 | extern inline void *UncAddr(void *val) 38 | { 39 | return (void*)(((u_int)val & UNCMASK)|UNCBASE); 40 | } 41 | 42 | namespace Flx 43 | { 44 | 45 | 46 | 47 | void ErrMessage(char *message); 48 | void switchThread(); 49 | void proceedAudio(); 50 | 51 | } 52 | 53 | 54 | 55 | #endif // _DEFS_H_ 56 | -------------------------------------------------------------------------------- /Code/Gel/Movies/Ngps/disp.h: -------------------------------------------------------------------------------- 1 | #ifndef _DISP_H_ 2 | #define _DISP_H_ 3 | 4 | #include 5 | 6 | #ifndef __CORE_DEFINES_H 7 | #include 8 | #endif 9 | #include 10 | #include 11 | 12 | namespace Flx 13 | { 14 | 15 | 16 | 17 | // //////////////////////////////////////////////////////////////// 18 | // 19 | // Functions 20 | // 21 | void clearGsMem(int r, int g, int b, int disp_width, int disp_height); 22 | void setImageTag(u_int *tags, void *image, int index, 23 | int image_w, int image_h); 24 | void startDisplay(int waitEven); 25 | void endDisplay(); 26 | 27 | } // namespace Flx 28 | 29 | #endif _DISP_H_ 30 | -------------------------------------------------------------------------------- /Code/Gel/Movies/Ngps/readbuf.h: -------------------------------------------------------------------------------- 1 | #ifndef _READBUF_H_ 2 | #define _READBUF_H_ 3 | 4 | #include 5 | 6 | #ifndef __CORE_DEFINES_H 7 | #include 8 | #endif 9 | #include 10 | #include 11 | 12 | 13 | #define READ_UNIT_SIZE (64*1024) 14 | #define N_READ_UNIT 5 15 | 16 | // //////////////////////////////////////////////////////////////// 17 | // 18 | // Read buffer 19 | // 20 | struct ReadBuf{ 21 | u_char data[N_READ_UNIT * READ_UNIT_SIZE]; 22 | int put; 23 | int count; 24 | int size; 25 | }; 26 | 27 | namespace Flx 28 | { 29 | 30 | 31 | 32 | // //////////////////////////////////////////////////////////////// 33 | // 34 | // Functions 35 | // 36 | void readBufCreate(ReadBuf *buff); 37 | void readBufDelete(ReadBuf *buff); 38 | int readBufBeginPut(ReadBuf *buff, u_char **ptr); 39 | int readBufEndPut(ReadBuf *buff, int size); 40 | int readBufBeginGet(ReadBuf *buff, u_char **ptr); 41 | int readBufEndGet(ReadBuf *buff, int size); 42 | 43 | } // namespace Flx 44 | 45 | #endif // _READBUF_H_ 46 | 47 | -------------------------------------------------------------------------------- /Code/Gel/Movies/Ngps/strfile.h: -------------------------------------------------------------------------------- 1 | #ifndef _STRFILE_H_ 2 | #define _STRFILE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #ifndef __CORE_DEFINES_H 8 | #include 9 | #endif 10 | #include 11 | #include 12 | 13 | // //////////////////////////////////////////////////////////////// 14 | // 15 | // Structure to read data from CD/DVD or HD 16 | // 17 | struct StrFile{ 18 | int isOnCD; // CD/DVD or HD 19 | int size; 20 | 21 | sceCdlFILE fp; // for CD/DVD stream 22 | u_char *iopBuf; 23 | 24 | int fd; // for HD stream 25 | }; 26 | 27 | namespace Flx 28 | { 29 | 30 | 31 | 32 | int strFileOpen(StrFile *file, char *filename, int pIopBuff); 33 | int strFileClose(StrFile *file); 34 | int strFileRead(StrFile *file, void *buff, int size); 35 | 36 | } // namespace Flx 37 | 38 | #endif // _STRFILE_H_ 39 | -------------------------------------------------------------------------------- /Code/Gel/Movies/Ngps/vobuf.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "gel/movies/ngps/defs.h" 3 | #include "gel/movies/ngps/vobuf.h" 4 | 5 | namespace Flx 6 | { 7 | 8 | 9 | 10 | 11 | // //////////////////////////////////////////////////////////////// 12 | // 13 | // Functions called from decoding thread 14 | // 15 | void voBufCreate( 16 | VoBuf *f, 17 | VoData *data, 18 | VoTag *tag, 19 | int size 20 | ) 21 | { 22 | int i; 23 | 24 | f->data = data; 25 | f->tag = tag; 26 | f->size = size; 27 | f->count = 0; 28 | f->write = 0; 29 | 30 | for (i = 0; i < size; i++) { 31 | f->tag[i].status = VOBUF_STATUS_; 32 | } 33 | } 34 | 35 | void voBufDelete(VoBuf *f) 36 | { 37 | } 38 | 39 | void voBufReset(VoBuf *f) 40 | { 41 | f->count = 0; 42 | f->write = 0; 43 | } 44 | 45 | int voBufIsFull(VoBuf *f) 46 | { 47 | return f->count == f->size; 48 | } 49 | 50 | void voBufIncCount(VoBuf *f) 51 | { 52 | // disable interrupt 53 | DI(); 54 | 55 | f->tag[f->write].status = VOBUF_STATUS_FULL; 56 | f->count++; 57 | f->write = (f->write + 1) % f->size; 58 | 59 | // enable interrupt 60 | EI(); 61 | } 62 | 63 | VoData *voBufGetData(VoBuf *f) 64 | { 65 | return voBufIsFull(f)? (VoData*)NULL: f->data + f->write; 66 | } 67 | 68 | // //////////////////////////////////////////////////////////////// 69 | // 70 | // Functions called from interrupt handler 71 | // 72 | int voBufIsEmpty(VoBuf *f) 73 | { 74 | return f->count == 0; 75 | } 76 | 77 | VoTag *voBufGetTag(VoBuf *f) 78 | { 79 | return voBufIsEmpty(f)? (VoTag*)NULL: 80 | f->tag + ((f->write - f->count + f->size) % f->size); 81 | } 82 | 83 | void voBufDecCount(VoBuf *f) 84 | { 85 | if (f->count > 0) { 86 | f->count--; 87 | } 88 | } 89 | 90 | } // namespace Flx 91 | -------------------------------------------------------------------------------- /Code/Gel/Movies/Xbox/p_movies.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | ** ** 3 | ** Neversoft Entertainment ** 4 | ** ** 5 | ** Copyright (C) 1999 - All Rights Reserved ** 6 | ** ** 7 | ****************************************************************************** 8 | ** ** 9 | ** Project: GEL (Game Engine Library) ** 10 | ** ** 11 | ** Module: ps2 movies ** 12 | ** ** 13 | ** File name: gel/movies/ngps/p_movies.h ** 14 | ** ** 15 | ** Created: 6/27/01 - dc ** 16 | ** ** 17 | *****************************************************************************/ 18 | 19 | #ifndef __P_MOVIES_H 20 | #define __P_MOVIES_H 21 | 22 | /***************************************************************************** 23 | ** Includes ** 24 | *****************************************************************************/ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | namespace Flx 34 | { 35 | 36 | void PMovies_PlayMovie( const char *pName ); 37 | 38 | } // namespace Flx 39 | 40 | #endif // __P_MOVIES_H 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Code/Gel/Movies/ngc/p_movies.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | ** ** 3 | ** Neversoft Entertainment ** 4 | ** ** 5 | ** Copyright (C) 1999 - All Rights Reserved ** 6 | ** ** 7 | ****************************************************************************** 8 | ** ** 9 | ** Project: GEL (Game Engine Library) ** 10 | ** ** 11 | ** Module: Movies ** 12 | ** ** 13 | ** File name: gel/movies/ngc/p_movies.h ** 14 | ** ** 15 | ** Created: 8/27/01 - dc ** 16 | ** ** 17 | *****************************************************************************/ 18 | 19 | #ifndef __P_MOVIES_H 20 | #define __P_MOVIES_H 21 | 22 | /***************************************************************************** 23 | ** Includes ** 24 | *****************************************************************************/ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace Flx 32 | { 33 | 34 | void PMovies_PlayMovie( const char *pName ); 35 | 36 | bool Movie_Render( void ); 37 | 38 | } // namespace Flx 39 | 40 | #endif // __P_MOVIES_H 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Bgm/PathDefs: -------------------------------------------------------------------------------- 1 | AR = C:/usr/local/sce/iop/gcc/bin/iop-elf-ar 2 | AS = C:/usr/local/sce/iop/gcc/mipsel-scei-elfl/bin/as 3 | CC = C:/usr/local/sce/iop/gcc/bin/iop-elf-gcc 4 | GCC = C:/usr/local/sce/iop/gcc/bin/iop-elf-gcc 5 | LD = C:/usr/local/sce/iop/gcc/mipsel-scei-elfl/bin/ld 6 | NM = C:/usr/local/sce/iop/gcc/bin/iop-elf-nm 7 | SIZE = C:/usr/local/sce/iop/gcc/bin/iop-elf-size 8 | STRIP = C:/usr/local/sce/iop/gcc/bin/iop-elf-strip 9 | RANLIB = C:/usr/local/sce/iop/gcc/bin/iop-elf-ranlib 10 | OBJCOPY = C:/usr/local/sce/iop/gcc/bin/iop-elf-objcopy 11 | OBJDUMP = C:/usr/local/sce/iop/gcc/bin/iop-elf-objdump 12 | IFIXUP = iopfixup 13 | ILBGEN = ioplibgen 14 | ILBLD = ioplibld 15 | ILBDUMP = ioplibdump 16 | BIN2OBJ = bin2elf 17 | -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Bgm/bgm_entr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "bgm_i.h" 8 | 9 | ModuleInfo Module = {"pcmaudio_driver", 0x0102 }; 10 | 11 | extern int sce_bgm_loop(); 12 | extern volatile int gStThid; 13 | 14 | int create_th(); 15 | 16 | int start () 17 | { 18 | struct ThreadParam param; 19 | int th; 20 | 21 | CpuEnableIntr(); 22 | 23 | if( ! sceSifCheckInit() ) 24 | sceSifInit(); 25 | sceSifInitRpc(0); 26 | 27 | printf("Entering PCM Audio Driver\n"); 28 | 29 | param.attr = TH_C; 30 | param.entry = sce_bgm_loop; 31 | param.initPriority = BASE_priority-2; 32 | param.stackSize = 0x800; 33 | param.option = 0; 34 | th = CreateThread(¶m); 35 | if (th > 0) { 36 | StartThread(th,0); 37 | printf("Exit PCM Audio Driver\n"); 38 | return 0; 39 | }else{ 40 | return 1; 41 | } 42 | } 43 | 44 | 45 | /* ---------------------------------------------------------------- 46 | * End on File 47 | * ---------------------------------------------------------------- */ 48 | /* DON'T ADD STUFF AFTER THIS */ 49 | 50 | -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Bgm/bgm_i.h: -------------------------------------------------------------------------------- 1 | //--- Highest bit indicates presence of return value 2 | #define EzBGM_INIT 0x8000 3 | #define EzBGM_QUIT 0x0010 4 | #define EzBGM_OPEN 0x8020 5 | #define EzBGM_CLOSE 0x0030 6 | #define EzBGM_PRELOAD 0x0040 7 | #define EzBGM_START 0x0050 8 | #define EzBGM_STOP 0x0060 9 | #define EzBGM_SEEK 0x0070 10 | #define EzBGM_SETVOL 0x8080 11 | #define EzBGM_SETVOLDIRECT 0x8090 12 | #define EzBGM_CLOSE_NO_WAIT 0x0100 13 | //#define EzBGM_SETMASTERVOL 0x00a0 14 | #define EzBGM_GETMODE 0x80b0 15 | #define EzBGM_SETMODE 0x80c0 16 | #define EzBGM_SDINIT 0x00d0 17 | 18 | 19 | //-- SET AVAILABLE 20 | #define BGM_MODE_REPEAT_OFF 0x0000 21 | #define BGM_MODE_REPEAT_DEFAULT 0x0001 22 | #define BGM_MODE_REPEAT_FORCED 0x0002 23 | 24 | #define BGM_MODE_STEREO 0x0000 25 | #define BGM_MODE_MONO 0x0010 26 | 27 | //-- GET ONLY 28 | #define BGM_MODE_IDLE 0x0000 29 | #define BGM_MODE_RUNNING 0x1000 30 | #define BGM_MODE_PAUSE 0x2000 31 | //#define BGM_MODE_KICKSTART 0x4000 32 | #define BGM_MODE_TERMINATE 0x8000 33 | 34 | 35 | #define BGM_MASK_STATUS 0x0FFF 36 | #define BGM_MASK_REPEAT 0xFFF0 37 | #define BGM_MASK_STEREO 0xFF0F 38 | 39 | #define WAV_STEREO_BIT ( 1 << 1 ) 40 | 41 | 42 | /* ---------------------------------------------- 43 | module ID number 44 | ----------------------------------------------- */ 45 | #define EZBGM_DEV 0x000666 46 | 47 | 48 | #define PRINTF(x) printf x 49 | //#define PRINTF(x) 50 | 51 | #define ERROR(x) printf x 52 | //#define ERROR(x) 53 | 54 | #define BASE_priority 42 55 | 56 | #define OLDLIB 0 57 | #define TRANS_CH 0 58 | 59 | -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Bgm/bgm_r2s.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gel/Music/Ngps/Bgm/bgm_r2s.s -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Bgm/bgm_r2sm.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define SPU_BLOCK 512 4 | 5 | // Using SP will speed things up, but ... 6 | 7 | void _BgmRaw2SpuMono( unsigned int *src, unsigned int *dst, unsigned int block ) 8 | { 9 | int i; 10 | 11 | for ( i = 0; i < block; i++ ) 12 | { 13 | memcpy( (void*)((int)dst+i*SPU_BLOCK*2), (void*)((int)src+i*SPU_BLOCK), SPU_BLOCK ); 14 | memcpy( (void*)((int)dst+i*SPU_BLOCK*2+SPU_BLOCK), (void*)((int)src+i*SPU_BLOCK) , SPU_BLOCK ); 15 | } 16 | 17 | return; 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Bgm/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(wildcard PathDefs),) 2 | PathDefs: 3 | iop-path-setup > PathDefs || (rm -f PathDefs ; exit 1) 4 | make all 5 | else 6 | include PathDefs 7 | endif 8 | 9 | INCDIR = -I/usr/local/sce/common/include -I/usr/local/sce/iop/install/include 10 | 11 | CFLAGS = $(INCDIR) -I. -Wall -G0 -g 12 | ASFLAGS = $(INCDIR) -G0 13 | 14 | COMPILE.s = $(CC) -xassembler-with-cpp $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c 15 | 16 | #----------- customize section -------------- 17 | PROGNAME = ezbgm 18 | 19 | OBJS = bgm_entr.o bgm_com.o bgm_play.o bgm_r2s.o bgm_r2sm.o 20 | #ILIBS = -ilb=$(TOP)lib/iop.ilb 21 | ILIBS = 22 | LIBI = /usr/local/sce/iop/install/lib 23 | 24 | #----------- rules -------------- 25 | all: $(PROGNAME).irx 26 | 27 | clean: 28 | rm -f *.o $(PROGNAME).irx *.obj *.map 29 | 30 | $(PROGNAME).irx: $(OBJS) 31 | $(LINK.o) -o $@ \ 32 | $(OBJS) -L../../../lib -L./ -L$(LIBI) -ilb=libsd.ilb -ilb=cdvdman.ilb 33 | 34 | -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Pcm/Makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(wildcard PathDefs),) 2 | PathDefs: 3 | iop-path-setup 4 | make all 5 | else 6 | include PathDefs 7 | endif 8 | 9 | TOPDIR = /usr/local/sce 10 | INCOPT = -I$(TOPDIR)/common/include -I$(TOPDIR)/iop/install/include 11 | 12 | CFLAGS = $(INCOPT) -I. -Wall -G0 -g -D__PLAT_NGPS__ 13 | ASFLAGS = $(INCOPT) -G0 14 | RM = /bin/rm -f 15 | 16 | COMPILE.s = $(CC) -xassembler-with-cpp $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c 17 | 18 | #----------- customize section -------------- 19 | PROGNAME = ezpcm 20 | 21 | OBJS = pcm_ent.o pcm_com.o pcm_sound.o 22 | #ILIBS = -ilb=$(TOP)lib/iop.ilb 23 | ILIBS = 24 | LIBI = /usr/local/sce/iop/install/lib 25 | 26 | #----------- rules -------------- 27 | all: $(PROGNAME).irx 28 | 29 | clean: 30 | rm -f *.o $(PROGNAME).irx *.obj *.map 31 | 32 | $(PROGNAME).irx: $(OBJS) 33 | $(LINK.o) -o $@ \ 34 | $(OBJS) -L../../../lib -L./ -L$(LIBI) -ilb=libsd.ilb 35 | 36 | pcm_ent.o: pcm.h pcmiop.h 37 | pcm_com.o: pcm.h pcmiop.h 38 | pcm_sound.o: pcm.h pcmiop.h 39 | 40 | -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Pcm/PathDefs: -------------------------------------------------------------------------------- 1 | AR = snarl.exe 2 | AS = ps2cc -iop 3 | CC = ps2cc -iop 4 | GCC = ps2cc -iop 5 | LD = ps2cc -iop 6 | NM = C:/usr/local/sce/iop/gcc/bin/iop-nm.exe 7 | SIZE = iop-size.exe 8 | STRIP = C:/usr/local/sce/iop/gcc/bin/iop-strip.exe 9 | RANLIB = C:/usr/local/sce/iop/gcc/bin/iop-ranlib.exe 10 | OBJCOPY = C:/usr/local/sce/iop/gcc/bin/iop-objcopy.exe 11 | OBJDUMP = C:/usr/local/sce/iop/gcc/bin/iop-objdump.exe 12 | IFIXUP = iopfixup.exe 13 | ILBGEN = C:/usr/local/sce/iop/gcc/bin/ioplibgen.exe 14 | ILBLD = C:/usr/local/sce/iop/gcc/mipsel-scei-elfl/bin/ioplibld.exe 15 | ILBDUMP = C:/usr/local/sce/iop/gcc/mipsel-scei-elfl/bin/ioplibdump.exe 16 | BIN2OBJ = bin2elf.exe 17 | -------------------------------------------------------------------------------- /Code/Gel/Music/Ngps/Pcm/pcm_ent.c: -------------------------------------------------------------------------------- 1 | /* Vag streaming into SPU2 -- Converted from Sony samples -- matt may 2001 */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "pcm.h" 10 | #include "pcmiop.h" 11 | 12 | ModuleInfo Module = {"pcm_driver", 0x0102}; 13 | 14 | // in command.c 15 | extern int sce_adpcm_loop (void); 16 | extern int sce_sound_loop (void); 17 | 18 | int start ( void ) 19 | { 20 | struct ThreadParam param; 21 | int th; 22 | 23 | if (! sceSifCheckInit ()) 24 | sceSifInit (); 25 | sceSifInitRpc (0); 26 | 27 | printf ("PCM driver version 666\n"); 28 | 29 | param.attr = TH_C; 30 | param.entry = sce_adpcm_loop; 31 | param.initPriority = BASE_priority - 2; 32 | param.stackSize = 0x800; 33 | param.option = 0; 34 | th = CreateThread (¶m); 35 | if (th > 0) { 36 | StartThread (th, 0); 37 | } else { 38 | return 1; 39 | } 40 | 41 | param.attr = TH_C; 42 | param.entry = sce_sound_loop; 43 | param.initPriority = BASE_priority - 2; 44 | param.stackSize = 0x800; 45 | param.option = 0; 46 | th = CreateThread (¶m); 47 | if (th > 0) { 48 | StartThread (th, 0); 49 | printf (" Exit PCM loader thread \n"); 50 | return 0; 51 | } else { 52 | return 1; 53 | } 54 | } 55 | 56 | /* ---------------------------------------------------------------- 57 | * End on File 58 | * ---------------------------------------------------------------- */ 59 | /* DON'T ADD STUFF AFTER THIS */ 60 | -------------------------------------------------------------------------------- /Code/Gel/Music/ngc/bgm/bgm_entr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "bgm_i.h" 8 | 9 | ModuleInfo Module = {"pcmaudio_driver", 0x0102 }; 10 | 11 | extern int sce_bgm_loop(); 12 | extern volatile int gStThid; 13 | 14 | int create_th(); 15 | 16 | int start () 17 | { 18 | struct ThreadParam param; 19 | int th; 20 | 21 | CpuEnableIntr(); 22 | 23 | if( ! sceSifCheckInit() ) 24 | sceSifInit(); 25 | sceSifInitRpc(0); 26 | 27 | printf("Entering PCM Audio Driver\n"); 28 | 29 | param.attr = TH_C; 30 | param.entry = sce_bgm_loop; 31 | param.initPriority = BASE_priority-2; 32 | param.stackSize = 0x800; 33 | param.option = 0; 34 | th = CreateThread(¶m); 35 | if (th > 0) { 36 | StartThread(th,0); 37 | printf("Exit PCM Audio Driver\n"); 38 | return 0; 39 | }else{ 40 | return 1; 41 | } 42 | } 43 | 44 | 45 | /* ---------------------------------------------------------------- 46 | * End on File 47 | * ---------------------------------------------------------------- */ 48 | /* DON'T ADD STUFF AFTER THIS */ 49 | 50 | -------------------------------------------------------------------------------- /Code/Gel/Music/ngc/bgm/bgm_i.h: -------------------------------------------------------------------------------- 1 | //--- Highest bit indicates presence of return value 2 | #define EzBGM_INIT 0x8000 3 | #define EzBGM_QUIT 0x0010 4 | #define EzBGM_OPEN 0x8020 5 | #define EzBGM_CLOSE 0x0030 6 | #define EzBGM_PRELOAD 0x0040 7 | #define EzBGM_START 0x0050 8 | #define EzBGM_STOP 0x0060 9 | #define EzBGM_SEEK 0x0070 10 | #define EzBGM_SETVOL 0x8080 11 | #define EzBGM_SETVOLDIRECT 0x8090 12 | #define EzBGM_CLOSE_NO_WAIT 0x0100 13 | //#define EzBGM_SETMASTERVOL 0x00a0 14 | #define EzBGM_GETMODE 0x80b0 15 | #define EzBGM_SETMODE 0x80c0 16 | #define EzBGM_SDINIT 0x00d0 17 | 18 | 19 | //-- SET AVAILABLE 20 | #define BGM_MODE_REPEAT_OFF 0x0000 21 | #define BGM_MODE_REPEAT_DEFAULT 0x0001 22 | #define BGM_MODE_REPEAT_FORCED 0x0002 23 | 24 | #define BGM_MODE_STEREO 0x0000 25 | #define BGM_MODE_MONO 0x0010 26 | 27 | //-- GET ONLY 28 | #define BGM_MODE_IDLE 0x0000 29 | #define BGM_MODE_RUNNING 0x1000 30 | #define BGM_MODE_PAUSE 0x2000 31 | //#define BGM_MODE_KICKSTART 0x4000 32 | #define BGM_MODE_TERMINATE 0x8000 33 | 34 | 35 | #define BGM_MASK_STATUS 0x0FFF 36 | #define BGM_MASK_REPEAT 0xFFF0 37 | #define BGM_MASK_STEREO 0xFF0F 38 | 39 | #define WAV_STEREO_BIT ( 1 << 1 ) 40 | 41 | 42 | /* ---------------------------------------------- 43 | module ID number 44 | ----------------------------------------------- */ 45 | #define EZBGM_DEV 0x000666 46 | 47 | 48 | #define PRINTF(x) printf x 49 | //#define PRINTF(x) 50 | 51 | #define ERROR(x) printf x 52 | //#define ERROR(x) 53 | 54 | #define BASE_priority 42 55 | 56 | #define OLDLIB 0 57 | #define TRANS_CH 0 58 | 59 | -------------------------------------------------------------------------------- /Code/Gel/Music/ngc/bgm/bgm_r2s.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gel/Music/ngc/bgm/bgm_r2s.s -------------------------------------------------------------------------------- /Code/Gel/Music/ngc/bgm/bgm_r2sm.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define SPU_BLOCK 512 4 | 5 | // Using SP will speed things up, but ... 6 | 7 | void _BgmRaw2SpuMono( unsigned int *src, unsigned int *dst, unsigned int block ) 8 | { 9 | int i; 10 | 11 | for ( i = 0; i < block; i++ ) 12 | { 13 | memcpy( (void*)((int)dst+i*SPU_BLOCK*2), (void*)((int)src+i*SPU_BLOCK), SPU_BLOCK ); 14 | memcpy( (void*)((int)dst+i*SPU_BLOCK*2+SPU_BLOCK), (void*)((int)src+i*SPU_BLOCK) , SPU_BLOCK ); 15 | } 16 | 17 | return; 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /Code/Gel/Music/ngc/pcm/pcm_ent.c: -------------------------------------------------------------------------------- 1 | /* Vag streaming into SPU2 -- Converted from Sony samples -- matt may 2001 */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "pcm.h" 10 | #include "pcmiop.h" 11 | 12 | ModuleInfo Module = {"pcm_driver", 0x0102}; 13 | 14 | // in command.c 15 | extern int sce_adpcm_loop (void); 16 | 17 | int start ( void ) 18 | { 19 | struct ThreadParam param; 20 | int th; 21 | 22 | if (! sceSifCheckInit ()) 23 | sceSifInit (); 24 | sceSifInitRpc (0); 25 | 26 | printf ("PCM driver version 666\n"); 27 | 28 | param.attr = TH_C; 29 | param.entry = sce_adpcm_loop; 30 | param.initPriority = BASE_priority - 2; 31 | param.stackSize = 0x800; 32 | param.option = 0; 33 | th = CreateThread (¶m); 34 | if (th > 0) { 35 | StartThread (th, 0); 36 | printf (" Exit PCM loader thread \n"); 37 | return 0; 38 | }else{ 39 | return 1; 40 | } 41 | } 42 | 43 | /* ---------------------------------------------------------------- 44 | * End on File 45 | * ---------------------------------------------------------------- */ 46 | /* DON'T ADD STUFF AFTER THIS */ 47 | -------------------------------------------------------------------------------- /Code/Gel/Music/ngc/pcm/pcmiop.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | #define PRINTF(x) printf x 3 | #else 4 | #define PRINTF(x) 5 | #endif 6 | #define ERROR(x) printf x 7 | #define xPRINTF(x) 8 | 9 | #define BASE_priority 32 10 | 11 | #define OLDLIB 0 12 | #define TRANS_CH 0 13 | 14 | -------------------------------------------------------------------------------- /Code/Gel/Object/ObjPtr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Obj 6 | { 7 | 8 | 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Code/Gel/Object/object.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gel/Object/object.cpp -------------------------------------------------------------------------------- /Code/Gel/RefCounted.h: -------------------------------------------------------------------------------- 1 | #ifndef __GEL_REFCOUNTED_H 2 | #define __GEL_REFCOUNTED_H 3 | 4 | namespace Obj 5 | { 6 | 7 | template class CSmtPtr; 8 | 9 | 10 | 11 | 12 | class CRefCounted : public Spt::Class 13 | { 14 | public: 15 | CRefCounted(); 16 | virtual ~CRefCounted(); 17 | 18 | void AddSmartPointer(CSmtPtr *pSmtPtr); 19 | void RemoveSmartPointer(CSmtPtr *pSmtPtr); 20 | 21 | void debug_validate_smart_pointers(CSmtPtr *pPtrToCheckForInclusion); 22 | 23 | protected: 24 | 25 | CSmtPtr * mp_smart_ptr_list; 26 | }; 27 | 28 | 29 | 30 | 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/checksum.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCRIPTING_CHECKSUM_H 2 | #define __SCRIPTING_CHECKSUM_H 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | namespace Script 9 | { 10 | 11 | void AllocateChecksumNameLookupTables(); 12 | void DeallocateChecksumNameLookupTables(); 13 | void GetChecksumNamesBuffer(char **pp_start, char **pp_end); 14 | void AddChecksumName(uint32 checksum, const char *pName); 15 | const char *FindChecksumNameNULL(uint32 checksum); 16 | const char *FindChecksumName(uint32 checksum); 17 | 18 | } // namespace Script 19 | 20 | #endif // #ifndef __SCRIPTING_CHECKSUM_H 21 | 22 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/file.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCRIPTING_FILE_H 2 | #define __SCRIPTING_FILE_H 3 | 4 | #ifndef __SCRIPTING_SCRIPTDEFS_H 5 | #include // For enums 6 | #endif 7 | 8 | namespace Script 9 | { 10 | 11 | void LoadQB(const char *p_fileName, 12 | EBoolAssertIfDuplicateSymbols assertIfDuplicateSymbols=NO_ASSERT_IF_DUPLICATE_SYMBOLS); 13 | void LoadQBFromMemory(const char* p_fileName, uint8* p_qb, EBoolAssertIfDuplicateSymbols assertIfDuplicateSymbols); 14 | void UnloadQB(uint32 fileNameChecksum); 15 | 16 | } // namespace Script 17 | 18 | #endif // #ifndef __SCRIPTING_FILE_H 19 | 20 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/init.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCRIPTING_INIT_H 2 | #define __SCRIPTING_INIT_H 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | namespace Script 9 | { 10 | 11 | enum 12 | { 13 | MAX_CSCRIPTS=300, // If this changes, the script debugger (qdebug.exe) will need to be rebuilt. 14 | }; 15 | 16 | class CStruct; 17 | class CScript; 18 | struct SCFunction 19 | { 20 | const char *mpName; 21 | bool (*mpFunction)(Script::CStruct *, Script::CScript *); 22 | }; 23 | 24 | void AllocatePools(); 25 | void DeallocatePools(); 26 | void RegisterCFunctions(SCFunction *p_cFunctions, uint32 numFunctions); 27 | void RegisterMemberFunctions(const char **pp_memberFunctions, uint32 numFunctions); 28 | 29 | } // namespace Script 30 | 31 | #endif // #ifndef __SCRIPTING_INIT_H 32 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/scriptdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCRIPTING_SCRIPTDEFS_H 2 | #define __SCRIPTING_SCRIPTDEFS_H 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | namespace Script 9 | { 10 | // A checksum of 0, used to represent no-name. 11 | #define NO_NAME ((uint32)0) 12 | 13 | enum EAssertType 14 | { 15 | NO_ASSERT=0, 16 | ASSERT 17 | }; 18 | 19 | enum EBoolAssertIfDuplicateSymbols 20 | { 21 | NO_ASSERT_IF_DUPLICATE_SYMBOLS=0, 22 | ASSERT_IF_DUPLICATE_SYMBOLS 23 | }; 24 | 25 | // So that the old code still compiles without having to change a million things. 26 | #define CScriptStructure CStruct 27 | #define SPair CPair 28 | #define NONAME NO_NAME 29 | 30 | } // namespace Script 31 | 32 | #endif // #ifndef __SCRIPTING_SCRIPTDEFS_H 33 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/string.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCRIPTING_STRING_H 2 | #define __SCRIPTING_STRING_H 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | namespace Script 9 | { 10 | 11 | void AllocatePermanentStringHeap(uint32 maxSize, uint32 maxStrings); 12 | void DeallocatePermanentStringHeap(); 13 | 14 | void UsePermanentStringHeap(); 15 | void UseRegularStringHeap(); 16 | 17 | char *CreateString(const char *p_string); 18 | void DeleteString(char *p_string); 19 | 20 | void SetScriptString(uint32 n, const char *p_string); 21 | char* GetScriptString(uint32 n); 22 | 23 | } // namespace Script 24 | 25 | #endif // #ifndef __SCRIPTING_STRING_H 26 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/symboltype.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // symboltype.cpp KSH 22 Oct 2001 4 | // 5 | // Just a utility function for printing a type name. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////////////// 8 | 9 | #include 10 | #include 11 | 12 | namespace Script 13 | { 14 | 15 | #ifdef __NOPT_ASSERT__ 16 | const char *GetTypeName(uint8 type) 17 | { 18 | switch (type) 19 | { 20 | case ESYMBOLTYPE_NONE: 21 | return "None"; 22 | break; 23 | case ESYMBOLTYPE_INTEGER: 24 | return "Integer"; 25 | break; 26 | case ESYMBOLTYPE_FLOAT: 27 | return "Float"; 28 | break; 29 | case ESYMBOLTYPE_STRING: 30 | return "String"; 31 | break; 32 | case ESYMBOLTYPE_LOCALSTRING: 33 | return "Local String"; 34 | break; 35 | case ESYMBOLTYPE_PAIR: 36 | return "Pair"; 37 | break; 38 | case ESYMBOLTYPE_VECTOR: 39 | return "Vector"; 40 | break; 41 | case ESYMBOLTYPE_QSCRIPT: 42 | return "Script"; 43 | break; 44 | case ESYMBOLTYPE_CFUNCTION: 45 | return "C-Function"; 46 | break; 47 | case ESYMBOLTYPE_MEMBERFUNCTION: 48 | return "Member Function"; 49 | break; 50 | case ESYMBOLTYPE_STRUCTURE: 51 | return "Structure"; 52 | break; 53 | case ESYMBOLTYPE_STRUCTUREPOINTER: 54 | return "Structure Pointer"; 55 | break; 56 | case ESYMBOLTYPE_ARRAY: 57 | return "Array"; 58 | break; 59 | case ESYMBOLTYPE_NAME: 60 | return "Name"; 61 | break; 62 | default: 63 | return "Unknown"; 64 | break; 65 | } 66 | } 67 | #else 68 | const char *GetTypeName(uint8 type) 69 | { 70 | return "(Hey, don't use GetTypeName on the CD!)"; 71 | } 72 | #endif 73 | 74 | } // namespace Script 75 | 76 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCRIPTING_UTILS_H 2 | #define __SCRIPTING_UTILS_H 3 | 4 | #ifndef __SCRIPTING_SCRIPTDEFS_H 5 | #include // For EAssertType 6 | #endif 7 | 8 | namespace Script 9 | { 10 | 11 | class CArray; 12 | class CStruct; 13 | class CComponent; 14 | 15 | void PrintContents(const CArray *p_array, int indent=0); 16 | void PrintContents(const CStruct *p_structure, int indent=0); 17 | 18 | uint32 WriteToBuffer(CStruct *p_structure, uint8 *p_buffer, uint32 bufferSize, EAssertType assert=ASSERT); 19 | uint32 CalculateBufferSize(CStruct *p_structure, uint32 tempBufferSize=100000); 20 | uint8 *ReadFromBuffer(CStruct *p_structure, uint8 *p_buffer); 21 | 22 | uint32 WriteToBuffer(CArray *p_array, uint8 *p_buffer, uint32 bufferSize, EAssertType assert=ASSERT); 23 | uint32 CalculateBufferSize(CArray *p_array); 24 | uint8 *ReadFromBuffer(CArray *p_array, uint8 *p_buffer); 25 | 26 | // This is used in eval.cpp, when evaluating foo[3] say. 27 | // Copies the array element indicated by index into the passed component. 28 | // The type of p_comp may be ESYMBOLTYPE_NONE if the type is not supported yet by not being in 29 | // the switch statement. 30 | void CopyArrayElementIntoComponent(CArray *p_array, uint32 index, CComponent *p_comp); 31 | void ResolveNameComponent(CComponent *p_comp); 32 | 33 | } 34 | 35 | #endif // #ifndef __SCRIPTING_UTILS_H 36 | 37 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/vecpair.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // vecpair.cpp KSH 17 Oct 2001 4 | // 5 | // Just defines the constructors and pool statics. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////////////// 8 | 9 | #include 10 | 11 | DefinePoolableClass(Script::CVector); 12 | DefinePoolableClass(Script::CPair); 13 | 14 | namespace Script 15 | { 16 | 17 | CVector::CVector() 18 | { 19 | // Initialise everything. CVector is not derived from CClass so we don't get 20 | // the auro-zeroing. 21 | mX=mY=mZ=0.0f; 22 | } 23 | 24 | // Note: No destructor needed. 25 | 26 | 27 | CPair::CPair() 28 | { 29 | // Initialise everything. CPair is not derived from CClass so we don't get 30 | // the auro-zeroing. 31 | mX=mY=0.0f; 32 | } 33 | 34 | // Note: No destructor needed. 35 | 36 | } // namespace Script 37 | 38 | -------------------------------------------------------------------------------- /Code/Gel/Scripting/vecpair.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCRIPTING_VECPAIR_H 2 | #define __SCRIPTING_VECPAIR_H 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | #ifndef __SYS_MEM_POOLABLE_H 9 | #include 10 | #endif 11 | 12 | namespace Script 13 | { 14 | 15 | // Note: These are not derived from CClass to avoid the extra memory overhead due to the virtual destructor. 16 | 17 | #ifdef __PLAT_WN32__ 18 | class CVector 19 | #else 20 | class CVector : public Mem::CPoolable 21 | #endif 22 | { 23 | public: 24 | CVector(); 25 | // No copy constructor or assignement operators needed, the defaults will work. 26 | 27 | union 28 | { 29 | CVector *mpNext; 30 | float mX; 31 | }; 32 | 33 | float mY; 34 | float mZ; 35 | }; 36 | 37 | #ifdef __PLAT_WN32__ 38 | class CPair 39 | #else 40 | class CPair : public Mem::CPoolable 41 | #endif 42 | { 43 | public: 44 | CPair(); 45 | // No copy constructor or assignement operators needed, the defaults will work. 46 | 47 | union 48 | { 49 | CPair *mpNext; 50 | float mX; 51 | }; 52 | 53 | float mY; 54 | }; 55 | 56 | } // namespace Script 57 | 58 | #endif // #ifndef __SCRIPTING_VECPAIR_H 59 | -------------------------------------------------------------------------------- /Code/Gfx/2D/BlurEffect.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_2D_BLUREFFECT_H__ 2 | #define __GFX_2D_BLUREFFECT_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace Script 8 | { 9 | class CStruct; 10 | } 11 | 12 | namespace Front 13 | { 14 | 15 | class CBlurEffect 16 | { 17 | public: 18 | 19 | struct Props 20 | { 21 | float topAlpha; 22 | float bottomAlpha; 23 | float bottomScaleX; 24 | float bottomScaleY; 25 | float maxDisplacementX; 26 | float maxDisplacementY; 27 | }; 28 | 29 | CBlurEffect(); 30 | ~CBlurEffect(); 31 | 32 | void Update(); 33 | 34 | CScreenElement::ConcatProps & GetInfo(int index); 35 | int GetNumEntries() {return 16;} 36 | Image::RGBA GetRGBA() {return m_rgba;} 37 | 38 | void SetAlphas(float top, float bottom) {m_target.topAlpha = top; m_target.bottomAlpha = bottom;} 39 | void SetBottomScales(float scaleX, float scaleY) {m_target.bottomScaleX = scaleX; m_target.bottomScaleY = scaleY;} 40 | void SetMaxDisplacements(float dispX, float dispY) {m_target.maxDisplacementX = dispX; m_target.maxDisplacementY = dispY;} 41 | void SetRGBA(Image::RGBA rgba) {m_rgba = rgba;} 42 | void SetAllTargetProps(const Props &newProps, Tmr::Time time); 43 | void SetAnimTime(Tmr::Time time); 44 | 45 | const Props & SetMorph(Script::CStruct *pProps, Tmr::Time *pRetTime = NULL); 46 | 47 | protected: 48 | 49 | CScreenElement::ConcatProps m_tab[16]; 50 | 51 | Props m_target; 52 | Props m_current; 53 | 54 | Tmr::Time m_last_time; 55 | Tmr::Time m_key_time; 56 | 57 | Image::RGBA m_rgba; 58 | }; 59 | 60 | } 61 | 62 | #endif // __GFX_2D_BLUREFFECT_H__ 63 | 64 | 65 | -------------------------------------------------------------------------------- /Code/Gfx/2D/SpriteElement.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_2D_SPRITEELEMENT_H__ 2 | #define __GFX_2D_SPRITEELEMENT_H__ 3 | 4 | #ifndef __GEL_OBJECT_H 5 | #include 6 | #endif 7 | #include 8 | 9 | namespace Nx 10 | { 11 | class CSprite; 12 | } 13 | 14 | namespace Front 15 | { 16 | 17 | class CSpriteElement : public CScreenElement 18 | { 19 | friend class CScreenElementManager; 20 | 21 | public: 22 | CSpriteElement(); 23 | virtual ~CSpriteElement(); 24 | 25 | void SetProperties(Script::CStruct *pProps); 26 | void SetMorph(Script::CStruct *pProps); 27 | 28 | void SetTexture(uint32 texture_checksum); 29 | void SetRotate( float angle, EForceInstant forceInstant = FORCE_INSTANT ); 30 | 31 | void WritePropertiesToStruct( Script::CStruct *pStruct ); 32 | 33 | protected: 34 | 35 | void update(); 36 | 37 | uint32 m_texture; 38 | 39 | Nx::CSprite * mp_sprite; 40 | }; 41 | 42 | 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Code/Gfx/2D/Window.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __PLAT_NGPS__ 6 | #include 7 | #endif 8 | 9 | namespace Front 10 | { 11 | 12 | 13 | 14 | 15 | CWindowElement::CWindowElement() 16 | { 17 | SetType(CScreenElement::TYPE_WINDOW_ELEMENT); 18 | mp_clip_window = Nx::CWindow2DManager::sGetWindowInstance(0, 0, 640, 448); 19 | } 20 | 21 | 22 | 23 | 24 | CWindowElement::~CWindowElement() 25 | { 26 | Dbg_Assert(mp_clip_window); 27 | Nx::CWindow2DManager::sFreeWindowInstance(mp_clip_window); 28 | } 29 | 30 | 31 | Nx::CWindow2D * CWindowElement::GetClipWindow() const 32 | { 33 | return mp_clip_window; 34 | } 35 | 36 | 37 | #if 0 38 | void CWindowElement::drawMainPart() 39 | { 40 | #ifdef __PLAT_NGPS__ 41 | NxPs2::SetTextWindow(0,639,0,447); // a full-screen clipping window 42 | #else 43 | printf ("WARNING: drawMainPart not the same on this platform....\n"); 44 | #endif 45 | } 46 | #endif 47 | 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Code/Gfx/2D/Window.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_2D_WINDOW_H__ 2 | #define __GFX_2D_WINDOW_H__ 3 | 4 | #include 5 | 6 | namespace Nx 7 | { 8 | class CWindow2D; 9 | } 10 | 11 | namespace Front 12 | { 13 | 14 | class CWindowElement : public Front::CScreenElement 15 | { 16 | public: 17 | 18 | CWindowElement(); 19 | virtual ~CWindowElement(); 20 | 21 | void SetClipWindow(Nx::CWindow2D *p_window); // This should probably be protected or private 22 | Nx::CWindow2D * GetClipWindow() const; 23 | 24 | protected: 25 | Nx::CWindow2D * mp_clip_window; 26 | 27 | }; 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/NX/anim.h: -------------------------------------------------------------------------------- 1 | #ifndef __ANIM_H 2 | #define __ANIM_H 3 | 4 | namespace NxNgc 5 | { 6 | 7 | //DWORD GetVertexShader( bool vertex_colors ); 8 | //void CreateWeightedMeshVertexShaders( void ); 9 | //void setup_weighted_mesh_vertex_shader( void *p_root_matrix, void *p_bone_matrices, int num_bone_matrices ); 10 | //void shutdown_weighted_mesh_vertex_shader( void ); 11 | 12 | 13 | } // namespace NxNgc 14 | 15 | #endif // __ANIM_H 16 | 17 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/NX/import.h: -------------------------------------------------------------------------------- 1 | #ifndef __IMPORT_H 2 | #define __IMPORT_H 3 | 4 | #include 5 | #include "texture.h" 6 | #include "gfx/nxtexture.h" 7 | 8 | namespace NxNgc 9 | { 10 | 11 | void LoadTextureFile( const char* Filename, Lst::HashTable * p_texture_table ); 12 | 13 | } // namespace NxNgc 14 | 15 | 16 | #endif // __IMPORT_H 17 | 18 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/NX/line.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINE_H 2 | #define __LINE_H 3 | 4 | #include "types.h" 5 | 6 | namespace NxNgc 7 | { 8 | 9 | 10 | void BeginLines2D(uint32 rgba); 11 | void DrawLine2D(float x0, float y0, float z0, float x1, float y1, float z1); 12 | void EndLines2D(void); 13 | void BeginLines3D(uint32 rgba); 14 | void DrawLine3D(float x0, float y0, float z0, float x1, float y1, float z1); 15 | void EndLines3D(void); 16 | 17 | } // namespace NxNgc 18 | 19 | 20 | #endif // __LINE_H 21 | 22 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/NX/occlude.h: -------------------------------------------------------------------------------- 1 | #ifndef __OCCLUDE_H__ 2 | #define __OCCLUDE_H__ 3 | 4 | namespace NxNgc 5 | { 6 | void AddOcclusionPoly( Mth::Vector &v0, Mth::Vector &v1, Mth::Vector &v2, Mth::Vector &v3, uint32 checksum = 0 ); 7 | void EnableOcclusionPoly( uint32 checksum, bool available ); 8 | void RemoveAllOcclusionPolys( void ); 9 | void BuildOccluders( Mth::Vector *p_cam_pos, int view ); 10 | bool TestSphereAgainstOccluders( Mth::Vector *p_sphere, uint32 meshes = 1 ); 11 | } 12 | 13 | #endif 14 | 15 | 16 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/NX/particles.h: -------------------------------------------------------------------------------- 1 | #ifndef __PARTICLE_H__ 2 | #define __PARTICLE_H__ 3 | 4 | #include "gfx\Ngc\nx\scene.h" 5 | #include "gfx\Ngc\nx\instance.h" 6 | #include "gfx/ngc/nx/mesh.h" 7 | 8 | namespace NxNgc 9 | { 10 | 11 | 12 | struct sParticleSystem 13 | { 14 | public: 15 | sParticleSystem( uint32 max_particles, uint32 texture_checksum, uint32 blendmode_checksum, int fix ); 16 | ~sParticleSystem( void ); 17 | 18 | void Render(); 19 | #ifdef SHORT_VERT 20 | s16 *GetVertexWriteBuffer( void ); 21 | #else 22 | float *GetVertexWriteBuffer( void ); 23 | #endif // SHORT_VERT 24 | GXColor *GetColorWriteBuffer( void ); 25 | sMaterial* GetMaterial( void ) { return mp_material; } 26 | NxNgc::sTexture * GetTexture( void ) { return mp_engine_texture; } 27 | 28 | sScene* mp_scene; 29 | 30 | float* mp_sphere; 31 | 32 | CInstance* mp_instance; 33 | 34 | sMaterial* mp_material; 35 | 36 | sMesh* mp_mesh; 37 | 38 | NxNgc::sTexture * mp_engine_texture; 39 | }; 40 | 41 | } 42 | 43 | #endif 44 | 45 | 46 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/NX/sprite.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPRITE_H 2 | #define __SPRITE_H 3 | 4 | #include "texture.h" 5 | 6 | namespace NxNgc 7 | { 8 | 9 | struct SDraw2D 10 | { 11 | SDraw2D( float pri = 0.0f, bool hide = true ); 12 | virtual ~SDraw2D( void ); 13 | 14 | void SetPriority( float pri ); 15 | float GetPriority( void ) const; 16 | 17 | void SetHidden( bool hide ); 18 | bool IsHidden( void ) const; 19 | 20 | // members 21 | SDraw2D *mp_next; 22 | 23 | // Statics 24 | static void DrawAll( void ); 25 | 26 | private: 27 | void InsertDrawList( void ); 28 | void RemoveDrawList( void ); 29 | 30 | virtual void BeginDraw( void ) = 0; 31 | virtual void Draw( void ) = 0; 32 | virtual void EndDraw( void ) = 0; 33 | 34 | // Not even the derived classes should have direct access 35 | bool m_hidden; 36 | float m_pri; 37 | 38 | // 2D draw list (sorted by priority); 39 | static SDraw2D *sp_2D_draw_list; 40 | }; 41 | 42 | 43 | struct sSprite : public SDraw2D 44 | { 45 | public: 46 | sSprite( float pri = 0.0f ); 47 | ~sSprite(); 48 | 49 | sTexture *mp_texture; 50 | 51 | float m_xpos; 52 | float m_ypos; 53 | uint16 m_width; 54 | uint16 m_height; 55 | float m_scale_x; 56 | float m_scale_y; 57 | float m_xhot; 58 | float m_yhot; 59 | float m_rot; 60 | uint32 m_rgba; 61 | 62 | private: 63 | 64 | // IDirect3DVertexBuffer8 *p_vertex_buffer; 65 | 66 | void BeginDraw(); 67 | void Draw(); 68 | void EndDraw(void); 69 | }; 70 | 71 | 72 | } // namespace NxNgc 73 | 74 | 75 | #endif // __SPRITE_H 76 | 77 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/NX/types.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPES_H 2 | #define __TYPES_H 3 | 4 | typedef unsigned int uint; 5 | typedef unsigned long long uint64; 6 | typedef unsigned int uint32; 7 | typedef unsigned short uint16; 8 | typedef unsigned char uint8; 9 | 10 | typedef signed int sint; 11 | typedef signed long long sint64; 12 | typedef signed int sint32; 13 | typedef signed short sint16; 14 | typedef signed char sint8; 15 | 16 | #endif // __TYPES_H 17 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_NxImposter.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxFont.h 3 | 4 | #ifndef __GFX_P_NX_IMPOSTER_H__ 5 | #define __GFX_P_NX_IMPOSTER_H__ 6 | 7 | #include "gfx/NxImposter.h" 8 | 9 | namespace Nx 10 | { 11 | 12 | ///////////////////////////////////////////////////////////////////////////////////// 13 | // Private classes 14 | // 15 | // Here's a machine specific implementation of the CImposterGroup 16 | class CNgcImposterGroup : public CImposterGroup 17 | { 18 | public: 19 | CNgcImposterGroup(); 20 | virtual ~CNgcImposterGroup(); 21 | 22 | 23 | private: // It's all private, as it is machine specific 24 | 25 | // Machine specific members 26 | }; 27 | 28 | } // Namespace Nx 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_NxSprite.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxScene.h 3 | 4 | #ifndef __GFX_P_NX_SPRITE_H__ 5 | #define __GFX_P_NX_SPRITE_H__ 6 | 7 | #include "Gfx/NxSprite.h" 8 | #include "Gfx/Ngc/NX/texture.h" 9 | #include "Gfx/Ngc/NX/sprite.h" 10 | 11 | namespace Nx 12 | { 13 | 14 | ///////////////////////////////////////////////////////////////////////////////////// 15 | // Private classes 16 | // 17 | // Machine specific implementation of the CSprite 18 | class CNgcSprite : public CSprite 19 | { 20 | public: 21 | CNgcSprite(); 22 | virtual ~CNgcSprite(); 23 | 24 | private: // It's all private, as it is machine specific 25 | virtual void plat_initialize(); 26 | 27 | virtual void plat_update_hidden(); // Tell engine of update 28 | virtual void plat_update_engine(); // Update engine primitives 29 | virtual void plat_update_priority(); 30 | 31 | NxNgc::sSprite * mp_plat_sprite; 32 | }; 33 | 34 | } // Namespace Nx 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_NxTextured3dPoly.cpp: -------------------------------------------------------------------------------- 1 | #include "Gfx/ngc/p_NxTextured3dPoly.h" 2 | 3 | namespace NxNgc 4 | { 5 | 6 | //////////////////////////////////////////////////////////////////////////////////// 7 | // Here's a machine specific implementation of CTextured3dPoly 8 | 9 | CNgcTextured3dPoly::CNgcTextured3dPoly() 10 | { 11 | } 12 | 13 | CNgcTextured3dPoly::~CNgcTextured3dPoly() 14 | { 15 | } 16 | 17 | void CNgcTextured3dPoly::plat_set_texture(uint32 texture_checksum) 18 | { 19 | } 20 | 21 | void CNgcTextured3dPoly::plat_render() 22 | { 23 | } 24 | 25 | } // Namespace NxNgc 26 | 27 | 28 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_NxTextured3dPoly.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_P_NX_TEXTURED_3D_POLY_H__ 2 | #define __GFX_P_NX_TEXTURED_3D_POLY_H__ 3 | 4 | #include 5 | 6 | namespace NxNgc 7 | { 8 | 9 | // Machine specific implementation of CTextured3dPoly 10 | class CNgcTextured3dPoly : public Nx::CTextured3dPoly 11 | { 12 | public: 13 | CNgcTextured3dPoly(); 14 | virtual ~CNgcTextured3dPoly(); 15 | private: 16 | void plat_render(); 17 | void plat_set_texture(uint32 texture_checksum); 18 | }; 19 | 20 | } // namespace NxNgc 21 | 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_NxViewport.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxViewport.cpp 3 | 4 | #include "Gfx/NGC/p_NxViewport.h" 5 | 6 | namespace Nx 7 | { 8 | 9 | //////////////////////////////////////////////////////////////////////////////////// 10 | // Here's a machine specific implementation of CViewport 11 | 12 | /******************************************************************/ 13 | /* */ 14 | /* */ 15 | /******************************************************************/ 16 | 17 | CNgcViewport::CNgcViewport() 18 | { 19 | } 20 | 21 | /******************************************************************/ 22 | /* */ 23 | /* */ 24 | /******************************************************************/ 25 | 26 | CNgcViewport::CNgcViewport( const Mth::Rect* rect, Gfx::Camera* cam) : 27 | CViewport(rect, cam) 28 | { 29 | } 30 | 31 | /******************************************************************/ 32 | /* */ 33 | /* */ 34 | /******************************************************************/ 35 | 36 | CNgcViewport::~CNgcViewport() 37 | { 38 | } 39 | 40 | ///////////////////////////////////////////////////////////////////////////////////// 41 | // Private classes 42 | // 43 | 44 | } // Namespace Nx 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_NxViewport.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxViewport.h 3 | 4 | #ifndef __GFX_P_NX_VIEWPORT_H__ 5 | #define __GFX_P_NX_VIEWPORT_H__ 6 | 7 | #include "Gfx/NxViewport.h" 8 | 9 | namespace Nx 10 | { 11 | 12 | ///////////////////////////////////////////////////////////////////////////////////// 13 | // Private classes 14 | // 15 | // Machine specific implementation of the CViewport 16 | class CNgcViewport : public CViewport 17 | { 18 | public: 19 | CNgcViewport(); 20 | CNgcViewport(const Mth::Rect* rect, Gfx::Camera* cam = NULL); 21 | virtual ~CNgcViewport(); 22 | 23 | private: // It's all private, as it is machine specific 24 | //virtual void plat_initialize(); 25 | 26 | }; 27 | 28 | } // Namespace Nx 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_memview.h: -------------------------------------------------------------------------------- 1 | //// 2 | 3 | #ifndef __P_MEMVIEW_H__ 4 | #define __P_MEMVIEW_H__ 5 | 6 | void MemView_Display(); 7 | void MemView_Input(uint buttons, uint makes, uint breaks); 8 | void MemView_Alloc( void *v); 9 | void MemView_Free( void *v); 10 | void MemViewToggle(); 11 | void MemView_FindLeaks(); 12 | int DumpUnwindStack( int iMaxDepth, int *pDest ); 13 | char *MemView_GetFunctionName(int pc, int *p_size); 14 | void MemView_DumpFragments(Mem::Heap *pHeap); 15 | void MemView_AnalyzeBlocks(uint32 mask = 0); 16 | void MemView_MarkBlocks(uint32 flags = 1 ); 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_nxanimcache.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: p_NxAnimCache.cpp 4 | //* OWNER: Gary Jesdanun 5 | //* CREATION DATE: 5/06/2002 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_P_NXANIMCACHE_H__ 9 | #define __GFX_P_NXANIMCACHE_H__ 10 | 11 | #include 12 | 13 | namespace Nx 14 | { 15 | /******************************************************************/ 16 | /* */ 17 | /* */ 18 | /******************************************************************/ 19 | 20 | ///////////////////////////////////////////////////////////////////////////////////// 21 | // 22 | // Here's a machine specific implementation of the CGeom 23 | 24 | class CNgcAnimCache : public CAnimCache 25 | { 26 | 27 | public: 28 | CNgcAnimCache( int lookupTableSize ); 29 | virtual ~CNgcAnimCache(); 30 | 31 | private: // It's all private, as it is machine specific 32 | }; 33 | 34 | } // Nx 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_nxparticle.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: p_nxParticle.h 4 | //* OWNER: Paul Robinson 5 | //* CREATION DATE: 3/27/2002 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_P_NX_PARTICLE_H__ 9 | #define __GFX_P_NX_PARTICLE_H__ 10 | 11 | #include "gfx/nxparticle.h" 12 | #include "gfx/ngc/nx/render.h" 13 | 14 | namespace Nx 15 | { 16 | 17 | /******************************************************************/ 18 | /* */ 19 | /* */ 20 | /******************************************************************/ 21 | 22 | NxNgc::BlendModes get_texture_blend( uint32 blend_checksum ); 23 | 24 | } // Nx 25 | 26 | #endif 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_nxscene.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxScene.h 3 | 4 | #ifndef __GFX_P_NX_SCENE_H__ 5 | #define __GFX_P_NX_SCENE_H__ 6 | 7 | #include "Gfx/Nx.h" 8 | #include "Gfx/Ngc/nx/scene.h" 9 | 10 | namespace Nx 11 | { 12 | 13 | ///////////////////////////////////////////////////////////////////////////////////// 14 | // Private classes 15 | // 16 | // Here's a machine specific implementation of the CScene 17 | class CNgcScene : public CScene 18 | { 19 | public: 20 | 21 | CNgcScene( int sector_table_size = 10 ); 22 | NxNgc::sScene * GetEngineScene() const { return mp_engine_scene; } 23 | void SetEngineScene( NxNgc::sScene *p_scene ) { mp_engine_scene = p_scene; } 24 | void DestroySectorMeshes( void ); 25 | 26 | private: // It's all private, as it is machine specific 27 | virtual void plat_post_load(); 28 | virtual bool plat_load_textures( const char *p_name ); // load textures 29 | virtual bool plat_load_collision( const char *p_name ); // load collision data 30 | virtual bool plat_unload_add_scene( void ); 31 | virtual CSector * plat_create_sector(); // empty sector 32 | 33 | 34 | NxNgc::sScene *mp_engine_scene; 35 | 36 | }; 37 | 38 | } // Namespace Nx 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_nxsector.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_P_NX_SECTOR_H__ 2 | #define __GFX_P_NX_SECTOR_H__ 3 | 4 | #include 5 | #include 6 | #include "gfx\NxSector.h" 7 | #include "gfx\Image\ImageBasic.h" 8 | 9 | #include "gfx\ngc\p_nxscene.h" 10 | #include "gfx\ngc\nx\mesh.h" 11 | #include "gfx\ngc\nx\geomnode.h" 12 | 13 | #include 14 | 15 | namespace NxNgc 16 | { 17 | class CGeomNode; 18 | } 19 | 20 | namespace Nx 21 | { 22 | 23 | ///////////////////////////////////////////////////////////////////////////////////// 24 | // Private classes 25 | // 26 | // Here's a machine specific implementation of the CSector 27 | class CNgcSector : public CSector 28 | { 29 | public: 30 | CNgcSector(); 31 | 32 | NxNgc::sObjectHeader* LoadFromFile( NxNgc::sObjectHeader* p_data ); 33 | NxNgc::sObjectHeader* LoadFromMemory( NxNgc::sObjectHeader* p_data ); 34 | 35 | private: // It's all private, as it is machine specific 36 | virtual void plat_set_color(Image::RGBA rgba); 37 | virtual void plat_clear_color(); 38 | virtual void plat_set_visibility(uint32 mask); 39 | virtual void plat_set_active(bool on); 40 | virtual void plat_set_world_position(const Mth::Vector& pos); 41 | virtual const Mth::CBBox &plat_get_bounding_box( void ) const; 42 | virtual const Mth::Vector & plat_get_world_position() const; 43 | virtual void plat_set_shatter( bool on ); 44 | virtual CSector * plat_clone(bool instance, CScene *p_dest_scene); 45 | 46 | int m_flags; 47 | 48 | Mth::Vector m_pos_offset; 49 | 50 | Image::RGBA m_rgba; 51 | }; 52 | 53 | } // Namespace Nx 54 | 55 | #endif -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_nxviewman.cpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // p_NxViewMan.cpp - Ngc platform specific interface to CViewportManager 3 | // 4 | // This is Ngc SPECIFIC!!!!!! So might get a bit messy 5 | 6 | #include 7 | 8 | #include "gfx/NxViewMan.h" 9 | #include "gfx/NGC/p_NxViewport.h" 10 | 11 | namespace Nx 12 | { 13 | 14 | 15 | ///////////////////////////////////////////////////////////////////////////////////// 16 | ///////////////////////////////////////////////////////////////////////////////////// 17 | // Functions 18 | 19 | 20 | /******************************************************************/ 21 | /* */ 22 | /* */ 23 | /******************************************************************/ 24 | 25 | CViewport * CViewportManager::s_plat_create_viewport(const Mth::Rect* rect, Gfx::Camera* cam) 26 | { 27 | return new CNgcViewport(rect, cam); 28 | } 29 | 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /Code/Gfx/NGC/p_nxwin2D.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxWin2D.h 3 | 4 | #ifndef __GFX_P_NX_WIN2D_H__ 5 | #define __GFX_P_NX_WIN2D_H__ 6 | 7 | #include "Gfx/NxWin2D.h" 8 | #include "Gfx/Ngc/NX/sprite.h" 9 | 10 | namespace Nx 11 | { 12 | 13 | ///////////////////////////////////////////////////////////////////////////////////// 14 | // Private classes 15 | // 16 | 17 | ///////////////////////////////////////////////////////////////////////////////////// 18 | // Here's a machine specific implementation of the CWindow2D 19 | class CNgcWindow2D : public CWindow2D 20 | { 21 | public: 22 | CNgcWindow2D(int x = 0, int y = 0, int width = 640, int height = 448); 23 | CNgcWindow2D(const Mth::Rect & win_rect); 24 | virtual ~CNgcWindow2D(); 25 | 26 | // NxNgc::SScissorWindow * GetEngineWindow() const; 27 | 28 | private: 29 | // 30 | virtual void plat_update_engine(); // Update engine primitives 31 | 32 | // Machine specific members 33 | // NxNgc::SScissorWindow * mp_plat_window; // Pointer to engine window 34 | short m_left, m_right, m_top, m_bottom; 35 | }; 36 | 37 | 38 | /******************************************************************/ 39 | /* */ 40 | /* */ 41 | /******************************************************************/ 42 | 43 | //inline NxNgc::SScissorWindow * CNgcWindow2D::GetEngineWindow() const 44 | //{ 45 | // return mp_plat_window; 46 | //} 47 | 48 | } // Namespace Nx 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/asmdma.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASMDMA_H 2 | #define __ASMDMA_H 3 | 4 | extern uint32 FogPalette[256]; 5 | extern uint FogDma; 6 | 7 | extern uint BillboardDma; 8 | extern uint BillboardContext; 9 | extern uint BillboardMats; 10 | 11 | #endif //__ASMDMA_H 12 | 13 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/dma.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gfx/NGPS/NX/dma.h -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/dmacalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __MODELS_H 2 | #define __MODELS_H 3 | 4 | 5 | namespace NxPs2 6 | { 7 | 8 | enum eDmaSubroutines 9 | { 10 | CLEAR_VRAM, 11 | FLIP_N_CLEAR, 12 | CLEAR_SCREEN, 13 | SET_RENDERSTATE, 14 | CLEAR_ZBUFFER, 15 | UPLOAD_TEXTURES, 16 | SET_FOGCOL, 17 | FLIP_N_CLEAR_LETTERBOX, 18 | 19 | NUM_SUBROUTINES 20 | }; 21 | 22 | 23 | uint8 *BeginDmaSubroutine(void); 24 | void EndDmaSubroutine(void); 25 | void BuildDmaSubroutines(void); 26 | 27 | //------------------------- 28 | // G L O B A L S 29 | //------------------------- 30 | 31 | extern uint8 *pSubroutine; 32 | 33 | } // namespace NxPs2 34 | 35 | 36 | #endif // __MODELS_H 37 | 38 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/fx.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "math.h" 3 | #include "fx.h" 4 | #include "asmdma.h" 5 | 6 | 7 | namespace NxPs2 8 | { 9 | 10 | 11 | 12 | void Fx::SetupFogPalette(uint32 FogRGBA, float Exponent) 13 | { 14 | int i,j; 15 | float t, alpha = (float)(int)(FogRGBA>>24); 16 | 17 | for (i=255,t=1.0f/256.0f; i>=0; i--,t+=1.0f/256.0f) 18 | { 19 | j = (i&0xE7) | (i&0x10)>>1 | (i&0x08)<<1; 20 | FogPalette[j] = (FogRGBA & 0x00FFFFFF) | (uint32)(int)(alpha * powf(t,Exponent) + 0.5f)<<24; 21 | } 22 | } 23 | 24 | 25 | 26 | } // namespace NxPs2 27 | 28 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/fx.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __NX_NGPS_FX_H 3 | #define __NX_NGPS_FX_H 4 | 5 | namespace NxPs2 6 | { 7 | 8 | namespace Fx 9 | { 10 | 11 | void SetupFogPalette(uint32 FogRGBA, float Exponent); 12 | 13 | } // namespace Fx 14 | 15 | } // namespace NxPs2 16 | 17 | #endif // __NX_NGPS_FX_H 18 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/gif.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gfx/NGPS/NX/gif.cpp -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/gif.h: -------------------------------------------------------------------------------- 1 | #ifndef __GIF_H 2 | #define __GIF_H 3 | 4 | 5 | namespace NxPs2 6 | { 7 | 8 | 9 | // GIFtag FLG definitions 10 | #define PACKED 0 11 | #define REGLIST 1 12 | #define IMAGE 2 13 | 14 | class gif 15 | { 16 | 17 | public: 18 | 19 | //------------------------------------------ 20 | // S T A T I C F U N C T I O N S 21 | //------------------------------------------ 22 | 23 | static void Tag1(uint32 Regs, uint NReg, uint Flg, uint Prim, uint Pre, uint Eop, uint NLoop, uint Addr); 24 | static void EndTag1(uint Eop); 25 | static void BeginTag1(uint32 Regs, uint NReg, uint Flg, uint Prim, uint Pre, uint Addr); 26 | static void BeginTag1_extended(uint32 Regs, uint NReg, uint Flg, uint Prim, uint Pre, uint Addr, uint Step); 27 | static void EndTagImmediate(uint Eop); 28 | static void BeginTagImmediate(uint32 Regs, uint NReg, uint Flg, uint Prim, uint Pre, uint Addr); 29 | static void Tag2(uint32 Regs, uint NReg, uint Flg, uint Prim, uint Pre, uint Eop, uint NLoop); 30 | static void EndTag2(uint Eop); 31 | static void BeginTag2(uint32 Regs, uint NReg, uint Flg, uint Prim, uint Pre); 32 | 33 | //-------------------------------- 34 | // S T A T I C D A T A 35 | //-------------------------------- 36 | 37 | static uint8 *pTag; 38 | 39 | }; // class gif 40 | 41 | 42 | } // namespace NxPs2 43 | 44 | 45 | #endif // __GIF_H 46 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/group.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "group.h" 3 | 4 | /* 5 | 6 | (Notes by Mick) 7 | 8 | A Group is a set of textures, and a set of meshes or primitives that use those textures. 9 | 10 | Rendering is performed one group at a time. 11 | 12 | The textures for a group are uploaded, and then it is rendered. 13 | 14 | Whilst a group is being rendered, the uploading of the next group's textures 15 | can start to be uploaded. 16 | 17 | This all happens asyncronously, whilst the CPU is doing the calculations for the next frame. 18 | 19 | The uploading/rendering cycle is syncronized by interrupts. 20 | 21 | The groups are rendered in this order: 22 | 23 | 1) PrologueGroup - set up in render.cpp - flips the display buffers and initializes VU1 microcode 24 | 2) The groups linked by PrologueGroup->pNext, which represent groups of textures and polygons 25 | 3) pEpilogue, (the last in this list) - uploads fonts and sprites, allowing them to be rendered next 26 | 27 | after the groups are rendered, we can render the 2D elements, namely the sprites and fonts (see render.cpp) 28 | 29 | */ 30 | 31 | 32 | namespace NxPs2 33 | { 34 | 35 | sGroup *sGroup::pHead; 36 | sGroup *sGroup::pTail; 37 | sGroup *sGroup::pShadow; 38 | sGroup *sGroup::pFog; 39 | sGroup *sGroup::pParticles; 40 | sGroup *sGroup::pEpilogue; 41 | volatile sGroup *sGroup::pUploadGroup; // Group that is currently uploading 42 | volatile sGroup *sGroup::pRenderGroup; // Group that is currently rendering 43 | uint32 sGroup::VramBufferBase; 44 | 45 | } // namespace NxPs2 46 | 47 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/group.h: -------------------------------------------------------------------------------- 1 | #ifndef __GROUP_H 2 | #define __GROUP_H 3 | 4 | 5 | namespace NxPs2 6 | { 7 | 8 | 9 | #define GROUPFLAG_TRANSPARENT (1<<0) 10 | #define GROUPFLAG_SKY (1<<1) 11 | #define GROUPFLAG_SORT (1<<2) 12 | 13 | 14 | class CVu1Context; 15 | struct STransformContext; 16 | 17 | 18 | struct sGroup 19 | { 20 | public: 21 | sGroup *pNext; 22 | 23 | float Priority; 24 | uint32 Checksum; 25 | uint32 flags; 26 | uint8 *pUpload[2]; 27 | uint8 *pRender[2]; 28 | uint8 *pListEnd[2]; 29 | bool Used[2]; // flag saying if this group is actually used this frame (has something in the pRender data) 30 | struct sMesh *pMeshes; 31 | int NumMeshes; 32 | uint vu1_loc; 33 | uint8 *p_tag; 34 | 35 | uint32 VramStart; 36 | uint32 VramEnd; 37 | 38 | struct sScene *pScene; 39 | 40 | sGroup *pPrev; 41 | 42 | static sGroup *pHead; 43 | static sGroup *pTail; 44 | static sGroup *pShadow; 45 | static sGroup *pFog; 46 | static sGroup *pParticles; 47 | static sGroup *pEpilogue; 48 | volatile static sGroup *pUploadGroup; 49 | volatile static sGroup *pRenderGroup; 50 | static uint32 VramBufferBase; 51 | //STransformContext *pTransformContext; 52 | CVu1Context *pVu1Context; 53 | uint32 profile_color; // color we display it as in the profiler 54 | }; 55 | 56 | } // namespace NxPs2 57 | 58 | #endif // __GROUP_H 59 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/line.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINE_H 2 | #define __LINE_H 3 | 4 | 5 | namespace NxPs2 6 | { 7 | 8 | 9 | void BeginLines2D(uint32 rgba); 10 | void DrawLine2D(float x0, float y0, float z0, float x1, float y1, float z1); 11 | void EndLines2D(void); 12 | void BeginLines3D(uint32 rgba); 13 | void ChangeLineColor(uint32 rgba); 14 | void DrawLine3D(float x0, float y0, float z0, float x1, float y1, float z1); 15 | void EndLines3D(void); 16 | 17 | } // namespace NxPs2 18 | 19 | 20 | #endif // __LINE_H 21 | 22 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/loadscreen.h: -------------------------------------------------------------------------------- 1 | #ifndef __NXPS2_LOADSCREEN_H 2 | #define __NXPS2_LOADSCREEN_H 3 | 4 | 5 | namespace NxPs2 6 | { 7 | 8 | // Enable and disable loading bar interrupt 9 | void StartLoadingBar(int frames); 10 | void RemoveLoadingBar(); 11 | 12 | 13 | // Loading bar data 14 | extern int gLoadBarTotalFrames; // Number of frames it takes for loading bar to go to 100% 15 | extern int gLoadBarNumFrames; // Number of frames so far 16 | extern float gLoadBarX; // Bar position 17 | extern float gLoadBarY; 18 | extern float gLoadBarWidth; // Bar size 19 | extern float gLoadBarHeight; 20 | extern int gLoadBarStartColor[4]; // 0 = red; 1 = green; 2 = blue; 3 = alpha 21 | extern int gLoadBarDeltaColor[4]; // 0 = delta red; 1 = delta green; 2 = delta blue; 3 = delta alpha 22 | extern float gLoadBarBorderWidth; // Border width 23 | extern float gLoadBarBorderHeight; // Border height 24 | extern int gLoadBarBorderColor[4]; // 0 = red; 1 = green; 2 = blue; 3 = alpha 25 | 26 | 27 | 28 | } // namespace NxPs2 29 | 30 | #endif // __NXPS2_LOADSCREEN_H 31 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/material.h: -------------------------------------------------------------------------------- 1 | #ifndef __MATERIAL_H 2 | #define __MATERIAL_H 3 | 4 | 5 | namespace NxPs2 6 | { 7 | 8 | // Material Flags 9 | #define MATFLAG_UV_WIBBLE (1<<0) 10 | #define MATFLAG_VC_WIBBLE (1<<1) 11 | #define MATFLAG_TEXTURED (1<<2) 12 | #define MATFLAG_ENVIRONMENT (1<<3) 13 | #define MATFLAG_DECAL (1<<4) 14 | #define MATFLAG_SMOOTH (1<<5) 15 | #define MATFLAG_TRANSPARENT (1<<6) 16 | #define MATFLAG_ONE_SIDED (1<<7) 17 | #define MATFLAG_INVISIBLE (1<<8) 18 | #define MATFLAG_TWO_SIDED (1<<9) 19 | #define MATFLAG_SPECULAR (1<<10) 20 | #define MATFLAG_ANIMATED_TEX (1<<11) 21 | #define MATFLAG_FORCE_ALPHA (1<<13) 22 | 23 | 24 | struct sMaterial 25 | { 26 | uint32 Flags; 27 | uint32 Checksum; 28 | struct sTexture *pTex; 29 | uint64 RegALPHA, RegTEX1, RegCLAMP; 30 | uint8 Aref; 31 | float* pUVWibbleInfo; 32 | uint32* pVCWibbleInfo; 33 | sint16 RefMapScaleU, RefMapScaleV; 34 | 35 | static uint32 Version; 36 | }; 37 | 38 | 39 | void * LoadMaterials(void *pFile, struct sScene *pScene, uint32 texDictOffset); 40 | 41 | 42 | } // namespace NxPs2 43 | 44 | #endif // __MATERIAL_H 45 | 46 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/nx_init.h: -------------------------------------------------------------------------------- 1 | #ifndef __NX_INIT_H 2 | #define __NX_INIT_H 3 | 4 | namespace NxPs2 5 | { 6 | 7 | void InitialiseEngine(void); 8 | void ResetEngine(void); 9 | void SuspendEngine(void); 10 | void AllocateExtraDMA(bool allocate); 11 | 12 | } // namespace NxPs2 13 | 14 | 15 | #endif // __NX_INIT_H 16 | 17 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/pcrtc.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCRTC_H 2 | #define __PCRTC_H 3 | 4 | namespace NxPs2 5 | { 6 | 7 | void SetupPCRTC(int Enable, int FFMode, int HRes=0, int VRes=0); 8 | 9 | } // namespace NxPs2 10 | 11 | #endif // __PCRTC_H 12 | 13 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef __RESOURCE_H 2 | #define __RESOURCE_H 3 | 4 | #include 5 | #include 6 | 7 | namespace NxPs2 8 | { 9 | 10 | // This static class locks certain system resources (like scratchpad and VU0 memory) 11 | // for code to use exclusively. Right now, there is no mechanism to lock out just 12 | // parts of memory, but it may be added in the future if needed. 13 | class CSystemResources 14 | { 15 | 16 | public: 17 | // Resource types 18 | enum EResourceType { 19 | vVU0_MEMORY = 0, 20 | vSCRATCHPAD_MEMORY, 21 | vNUM_RESOURCES 22 | }; 23 | 24 | //------------------------------------------- 25 | 26 | static void sInitResources(); // Call only at the beginning! 27 | 28 | static bool sRequestResource(EResourceType resource); // Returns true if it was able to lock it 29 | static void sFreeResource(EResourceType resource); 30 | 31 | private: 32 | static bool s_resource_used[vNUM_RESOURCES]; 33 | 34 | }; 35 | 36 | 37 | } // namespace NxPs2 38 | 39 | 40 | 41 | #endif // __RESOURCE_H 42 | 43 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/switches.h: -------------------------------------------------------------------------------- 1 | #ifndef __SWITCHES_H 2 | #define __SWITCHES_H 3 | 4 | #ifdef __PLAT_NGPS__ 5 | #include 6 | #endif // __PLAT_NGPS__ 7 | 8 | #define malloc(x) error Old Memory Function 9 | #define calloc(x) error Old Memory Function 10 | #define realloc(x) error Old Memory Function 11 | #define free(x) error Old Memory Function 12 | 13 | 14 | namespace NxPs2 15 | { 16 | 17 | #define USE_INTERRUPTS 1 18 | #define GIF_INTERRUPT 1 19 | #define VIF1_INTERRUPT 0 20 | #define GS_INTERRUPT 1 21 | 22 | #define TIMING_BARS 0 23 | 24 | #define C32 1 25 | #define C16 0 26 | #define Z24 1 27 | #define Z16 0 28 | 29 | #ifdef __PLAT_NGPS__ 30 | 31 | #define HRES_NTSC (640) 32 | #define VRES_NTSC (448) 33 | #define HRES_PAL (512) 34 | #define VRES_PAL (512) 35 | 36 | #define HRES (Config::NTSC() ? HRES_NTSC : HRES_PAL) 37 | #define VRES (Config::NTSC() ? VRES_NTSC : VRES_PAL) 38 | 39 | #define XOFFSET ((2048 - (HRES >> 1)) << 4) 40 | #define YOFFSET ((2048 - (VRES >> 1)) << 4) 41 | 42 | // Start and size of buffers in 2K Word size blocks 43 | #define FRAME_START (0) 44 | #define FRAME_SIZE (((HRES * VRES) * 4) / (2048 * 4)) // 32-bit frame buffer 45 | #define DISPLAY_START (FRAME_START + FRAME_SIZE) 46 | #define DISPLAY_SIZE (((HRES * VRES) * 2) / (2048 * 4)) // 16-bit display buffer 47 | #define ZBUFFER_START (DISPLAY_START + DISPLAY_SIZE) 48 | #define ZBUFFER_SIZE (((HRES * VRES) * 4) / (2048 * 4)) // 32-bit aligned ZBuffer 49 | 50 | #endif // __PLAT_NGPS__ 51 | 52 | #define FTOI_TRICK 1 53 | 54 | #define STENCIL_SHADOW 0 55 | #define OLD_FOG 0 56 | 57 | } // namespace NxPs2 58 | 59 | #endif // __SWITCHES_H 60 | 61 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/types.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPES_H 2 | #define __TYPES_H 3 | 4 | typedef unsigned int uint; 5 | typedef unsigned long uint64; 6 | typedef unsigned int uint32; 7 | typedef unsigned short uint16; 8 | typedef unsigned char uint8; 9 | 10 | typedef signed int sint; 11 | typedef signed long sint64; 12 | typedef signed int sint32; 13 | typedef signed short sint16; 14 | typedef signed char sint8; 15 | 16 | #endif // __TYPES_H 17 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/vif.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gfx/NGPS/NX/vif.h -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/vu0code.h: -------------------------------------------------------------------------------- 1 | #ifndef __VU0CODE_H 2 | #define __VU0CODE_H 3 | 4 | extern uint MPGStart0[8]; // Mick: The [8] is a patch to make the compiler not assume it is in ldata 5 | extern uint MPGEnd0[8]; 6 | 7 | extern uint TestFunc; 8 | extern uint InitialiseOccluders; 9 | extern uint TestSphereAgainstOccluders; 10 | extern uint RayTriangleCollision; 11 | extern uint BatchRayTriangleCollision; 12 | extern uint ViewCullTest; 13 | extern uint OuterCullTest; 14 | extern uint BothCullTests; 15 | 16 | #endif //__VU0CODE_H 17 | 18 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/vu1/defs.vsm: -------------------------------------------------------------------------------- 1 | 2 | .equr zero, VF00x 3 | .equr one, VF00w 4 | 5 | 6 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/vu1/jumptab.vsm: -------------------------------------------------------------------------------- 1 | 2 | JumpTable: 3 | ; load at micromem address 0 4 | 5 | ; initially the branch addresses will be static 6 | ; but they can later be written dynamically by a vu code caching system 7 | NOP B Init 8 | NOP NOP 9 | NOP B ProcessPacket 10 | NOP NOP 11 | NOP B VU1Context 12 | NOP NOP 13 | NOP B GSContext 14 | NOP NOP 15 | NOP B SpritesInit 16 | NOP NOP 17 | NOP B Sprites 18 | NOP NOP 19 | ;NOP B ScreenAlignedBillboards 20 | ;NOP NOP 21 | ;NOP B AxialBillboards 22 | ;NOP NOP 23 | 24 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/vu1/main.vsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gfx/NGPS/NX/vu1/main.vsm -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/vu1/newvu1code.dsm: -------------------------------------------------------------------------------- 1 | 2 | .global NewMPGStart 3 | .global NewMPGEnd 4 | 5 | .include "defs.vsm" 6 | 7 | ; align to a 2^7=128 byte boundary for faster dma transfer 8 | .align 7 9 | 10 | NewMPGStart: 11 | 12 | .DmaData ParticleVU1CodeStart 13 | 14 | MPG 0, * 15 | 16 | .include "jumptab.vsm" 17 | .include "main.vsm" 18 | .include "particle.vsm" 19 | ;.include "billboard.vsm" 20 | 21 | .EndMPG 22 | 23 | .EndDmaData 24 | NewMPGEnd: 25 | 26 | ; force rebuild 27 | 28 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/vu1/newvu1code.h: -------------------------------------------------------------------------------- 1 | #ifndef __NEWVU1CODE_H 2 | #define __NEWVU1CODE_H 3 | 4 | #ifdef __PLAT_NGPS__ 5 | 6 | extern uint NewMPGStart __attribute__((section(".vudata"))); 7 | extern uint NewMPGEnd __attribute__((section(".vudata"))); 8 | 9 | #endif 10 | 11 | #endif //__NEWVU1CODE_H 12 | 13 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/NX/vu1code.dsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gfx/NGPS/NX/vu1code.dsm -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxAnimCache.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: p_NxAnimCache.cpp 4 | //* OWNER: Gary Jesdanun 5 | //* CREATION DATE: 5/06/2002 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_P_NXANIMCACHE_H__ 9 | #define __GFX_P_NXANIMCACHE_H__ 10 | 11 | #include 12 | 13 | namespace Nx 14 | { 15 | /******************************************************************/ 16 | /* */ 17 | /* */ 18 | /******************************************************************/ 19 | 20 | ///////////////////////////////////////////////////////////////////////////////////// 21 | // 22 | // Here's a machine specific implementation of the CGeom 23 | 24 | class CPs2AnimCache : public CAnimCache 25 | { 26 | 27 | public: 28 | CPs2AnimCache( int lookupTableSize ); 29 | virtual ~CPs2AnimCache(); 30 | 31 | private: // It's all private, as it is machine specific 32 | }; 33 | 34 | } // Nx 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxFontMan.cpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // p_NxFontMan.cpp - PS2 platform specific interface to the Font Manager 3 | // 4 | // This is PS2 SPECIFIC!!!!!! So might get a bit messy 5 | // 6 | 7 | #include "gfx\nx.h" 8 | #include "gfx\NxFontMan.h" 9 | #include "gfx\NGPS\p_NxFont.h" 10 | 11 | #include "gfx\ngps\nx\chars.h" 12 | 13 | namespace Nx 14 | { 15 | 16 | 17 | ///////////////////////////////////////////////////////////////////////////////////// 18 | ///////////////////////////////////////////////////////////////////////////////////// 19 | // Functions 20 | 21 | 22 | /******************************************************************/ 23 | /* */ 24 | /* */ 25 | /******************************************************************/ 26 | 27 | CFont * CFontManager::s_plat_load_font(const char *pName) 28 | { 29 | CPs2Font *p_new_font; 30 | 31 | p_new_font = new CPs2Font; 32 | p_new_font->Load(pName); 33 | 34 | return p_new_font; 35 | } 36 | 37 | /******************************************************************/ 38 | /* */ 39 | /* */ 40 | /******************************************************************/ 41 | 42 | void CFontManager::s_plat_unload_font(CFont *pFont) 43 | { 44 | pFont->Unload(); 45 | } 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxImposter.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxFont.h 3 | 4 | #ifndef __GFX_P_NX_IMPOSTER_H__ 5 | #define __GFX_P_NX_IMPOSTER_H__ 6 | 7 | #include "gfx/NxImposter.h" 8 | 9 | namespace Nx 10 | { 11 | 12 | ///////////////////////////////////////////////////////////////////////////////////// 13 | // Private classes 14 | // 15 | // Here's a machine specific implementation of the CImposterGroup 16 | class CPs2ImposterGroup : public CImposterGroup 17 | { 18 | public: 19 | CPs2ImposterGroup(); 20 | virtual ~CPs2ImposterGroup(); 21 | 22 | 23 | private: // It's all private, as it is machine specific 24 | 25 | // Machine specific members 26 | }; 27 | 28 | } // Namespace Nx 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxLightMan.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | // p_NxLightMan.H - Neversoft Engine, Rendering portion, Platform dependent interface 3 | 4 | #ifndef __GFX_P_NX_LIGHT_MAN_H__ 5 | #define __GFX_P_NX_LIGHT_MAN_H__ 6 | 7 | #ifndef __CORE_DEFINES_H 8 | #include 9 | #endif 10 | 11 | #include 12 | 13 | #include 14 | 15 | 16 | namespace Nx 17 | { 18 | 19 | /******************************************************************/ 20 | /* */ 21 | /* */ 22 | /******************************************************************/ 23 | 24 | /////////////////////////////////////////////////////////////////////////////////// 25 | // Nx::CPs2LightManager 26 | class CPs2LightManager : public CLightManager 27 | { 28 | public: 29 | 30 | // Does any once-per-frame light update 31 | static void sUpdateEngine( void ); 32 | 33 | // Model Lights List functions 34 | static bool sAddToModelLightsList(CModelLights *p_model_lights); 35 | static bool sRemoveFromModelLightsList(CModelLights *p_model_lights); 36 | 37 | private: 38 | 39 | // once-per-frame update functions called from sUpdateEngine() 40 | static void s_update_model_lights(); 41 | 42 | // Model light list 43 | static Lst::Head< CModelLights > s_model_lights_list; 44 | }; 45 | 46 | } 47 | 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxModel.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: p_nxModel.h 4 | //* OWNER: Gary Jesdanun 5 | //* CREATION DATE: 1/8/2002 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_P_NX_MODEL_H__ 9 | #define __GFX_P_NX_MODEL_H__ 10 | 11 | #include "gfx/nxmodel.h" 12 | 13 | 14 | namespace NxPs2 15 | { 16 | class CInstance; 17 | struct sScene; 18 | } 19 | 20 | namespace Nx 21 | { 22 | 23 | /******************************************************************/ 24 | /* */ 25 | /* */ 26 | /******************************************************************/ 27 | 28 | ///////////////////////////////////////////////////////////////////////////////////// 29 | // 30 | // Here's a machine specific implementation of the CModel 31 | 32 | class CPs2Model : public CModel 33 | { 34 | 35 | public: 36 | CPs2Model(); 37 | virtual ~CPs2Model(); 38 | Mth::Matrix* GetMatrices(); 39 | 40 | private: // It's all private, as it is machine specific 41 | bool plat_init_skeleton( int numBones ); 42 | Mth::Vector plat_get_bounding_sphere(); 43 | void plat_set_bounding_sphere( const Mth::Vector& boundingSphere ); 44 | 45 | private: 46 | Mth::Matrix* mp_matrices; 47 | }; 48 | 49 | /******************************************************************/ 50 | /* */ 51 | /* */ 52 | /******************************************************************/ 53 | 54 | } // Nx 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxSprite.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxScene.h 3 | 4 | #ifndef __GFX_P_NX_SPRITE_H__ 5 | #define __GFX_P_NX_SPRITE_H__ 6 | 7 | #include "Gfx/NxSprite.h" 8 | #include "Gfx/NGPS/NX/texture.h" 9 | #include "Gfx/NGPS/NX/sprite.h" 10 | 11 | namespace Nx 12 | { 13 | 14 | ///////////////////////////////////////////////////////////////////////////////////// 15 | // Private classes 16 | // 17 | // Machine specific implementation of the CSprite 18 | class CPs2Sprite : public CSprite 19 | { 20 | public: 21 | CPs2Sprite(CWindow2D *p_window = NULL); 22 | virtual ~CPs2Sprite(); 23 | 24 | private: // It's all private, as it is machine specific 25 | virtual void plat_initialize(); 26 | 27 | virtual void plat_update_hidden(); // Tell engine of update 28 | virtual void plat_update_engine(); // Update engine primitives 29 | virtual void plat_update_priority(); 30 | virtual void plat_update_window(); 31 | 32 | NxPs2::SSprite * mp_plat_sprite; 33 | }; 34 | 35 | } // Namespace Nx 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxTextured3dPoly.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace NxPs2 9 | { 10 | 11 | CPs2Textured3dPoly::CPs2Textured3dPoly() 12 | { 13 | } 14 | 15 | CPs2Textured3dPoly::~CPs2Textured3dPoly() 16 | { 17 | } 18 | 19 | void CPs2Textured3dPoly::plat_set_texture(uint32 texture_checksum) 20 | { 21 | Nx::CTexture *p_texture = Nx::CTexDictManager::sp_sprite_tex_dict->GetTexture(texture_checksum); 22 | Dbg_MsgAssert(p_texture, ("no texture found for sprite")); 23 | Nx::CPs2Texture *p_ps2_texture = static_cast( p_texture ); 24 | Dbg_MsgAssert(p_ps2_texture,("NULL p_ps2_texture")); 25 | mp_engine_texture = p_ps2_texture->GetSingleTexture(); 26 | Dbg_MsgAssert(mp_engine_texture,("NULL mp_engine_texture")); 27 | } 28 | 29 | void CPs2Textured3dPoly::plat_render() 30 | { 31 | CImmediateMode::sStartPolyDraw( mp_engine_texture, PackALPHA(0,0,0,0,0), ABS ); 32 | 33 | CImmediateMode::sDrawQuadTexture(mp_engine_texture, mp_pos[0], mp_pos[1], mp_pos[2], mp_pos[3], 0x80808080,0x80808080,0x80808080,0x80808080); 34 | } 35 | 36 | 37 | } // Namespace NxPs2 38 | 39 | 40 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxTextured3dPoly.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_P_NX_TEXTURED_3D_POLY_H__ 2 | #define __GFX_P_NX_TEXTURED_3D_POLY_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace NxPs2 8 | { 9 | 10 | // Machine specific implementation of CTextured3dPoly 11 | class CPs2Textured3dPoly : public Nx::CTextured3dPoly 12 | { 13 | public: 14 | CPs2Textured3dPoly(); 15 | virtual ~CPs2Textured3dPoly(); 16 | private: 17 | void plat_render(); 18 | void plat_set_texture(uint32 texture_checksum); 19 | 20 | NxPs2::SSingleTexture* mp_engine_texture; 21 | }; 22 | 23 | } // namespace NxPs2 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxViewMan.cpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // p_NxViewMan.cpp - PS2 platform specific interface to CViewportManager 3 | // 4 | // This is PS2 SPECIFIC!!!!!! So might get a bit messy 5 | 6 | #include 7 | 8 | #include "gfx/NxViewMan.h" 9 | #include "gfx/NGPS/p_NxViewport.h" 10 | 11 | namespace Nx 12 | { 13 | 14 | 15 | ///////////////////////////////////////////////////////////////////////////////////// 16 | ///////////////////////////////////////////////////////////////////////////////////// 17 | // Functions 18 | 19 | 20 | /******************************************************************/ 21 | /* */ 22 | /* */ 23 | /******************************************************************/ 24 | 25 | CViewport * CViewportManager::s_plat_create_viewport(const Mth::Rect* rect, Gfx::Camera* cam) 26 | { 27 | return new CPs2Viewport(rect, cam); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxViewport.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxViewport.h 3 | 4 | #ifndef __GFX_P_NX_VIEWPORT_H__ 5 | #define __GFX_P_NX_VIEWPORT_H__ 6 | 7 | #include "Gfx/NxViewport.h" 8 | 9 | namespace Nx 10 | { 11 | 12 | ///////////////////////////////////////////////////////////////////////////////////// 13 | // Private classes 14 | // 15 | // Machine specific implementation of the CViewport 16 | class CPs2Viewport : public CViewport 17 | { 18 | public: 19 | CPs2Viewport(); 20 | CPs2Viewport(const Mth::Rect* rect, Gfx::Camera* cam = NULL); 21 | virtual ~CPs2Viewport(); 22 | 23 | protected: 24 | void update_render_vars(); 25 | 26 | private: // It's all private, as it is machine specific 27 | virtual float plat_transform_to_screen_coord(const Mth::Vector & world_pos, float & screen_pos_x, float & screen_pos_y, ZBufferValue & screen_pos_z); 28 | 29 | }; 30 | 31 | } // Namespace Nx 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_NxWin2D.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxWin2D.h 3 | 4 | #ifndef __GFX_P_NX_WIN2D_H__ 5 | #define __GFX_P_NX_WIN2D_H__ 6 | 7 | #include "Gfx/NxWin2D.h" 8 | #include "Gfx/NGPS/NX/sprite.h" 9 | 10 | namespace Nx 11 | { 12 | 13 | ///////////////////////////////////////////////////////////////////////////////////// 14 | // Private classes 15 | // 16 | 17 | ///////////////////////////////////////////////////////////////////////////////////// 18 | // Here's a machine specific implementation of the CWindow2D 19 | class CPs2Window2D : public CWindow2D 20 | { 21 | public: 22 | CPs2Window2D(int x = 0, int y = 0, int width = 640, int height = 448); 23 | CPs2Window2D(const Mth::Rect & win_rect); 24 | virtual ~CPs2Window2D(); 25 | 26 | NxPs2::SScissorWindow * GetEngineWindow() const; 27 | 28 | private: 29 | // 30 | virtual void plat_update_engine(); // Update engine primitives 31 | 32 | // Machine specific members 33 | NxPs2::SScissorWindow * mp_plat_window; // Pointer to engine window 34 | }; 35 | 36 | 37 | /******************************************************************/ 38 | /* */ 39 | /* */ 40 | /******************************************************************/ 41 | 42 | inline NxPs2::SScissorWindow * CPs2Window2D::GetEngineWindow() const 43 | { 44 | return mp_plat_window; 45 | } 46 | 47 | } // Namespace Nx 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_memview.h: -------------------------------------------------------------------------------- 1 | //// 2 | 3 | #ifndef __P_MEMVIEW_H__ 4 | #define __P_MEMVIEW_H__ 5 | 6 | void MemView_Display(); 7 | void MemView_Input(uint buttons, uint makes, uint breaks); 8 | void MemView_Alloc( void *v); 9 | void MemView_Free( void *v); 10 | void MemViewToggle(); 11 | void MemView_FindLeaks(); 12 | int DumpUnwindStack( int iMaxDepth, int *pDest ); 13 | char *MemView_GetFunctionName(int pc, int *p_size); 14 | void MemView_DumpFragments(Mem::Heap *pHeap); 15 | void MemView_AnalyzeBlocks(uint32 mask = 0); 16 | void MemView_MarkBlocks(uint32 flags = 1 ); 17 | void MemView_DumpHeap(Mem::Heap *pHeap, uint32 mask =0); 18 | void MemView_AnalyzeHeap(Mem::Heap *pHeap); 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /Code/Gfx/NGPS/p_nxparticle.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: p_nxParticle.h 4 | //* OWNER: Paul Robinson 5 | //* CREATION DATE: 3/27/2002 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_P_NX_PARTICLE_H__ 9 | #define __GFX_P_NX_PARTICLE_H__ 10 | 11 | #include "gfx/nxparticle.h" 12 | 13 | /******************************************************************/ 14 | /* */ 15 | /* */ 16 | /******************************************************************/ 17 | 18 | 19 | #endif 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Code/Gfx/NxAnimCache.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: NxAnimCache.cpp 4 | //* OWNER: Gary Jesdanun 5 | //* CREATION DATE: 5/06/2002 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_NXANIMCACHE_H__ 9 | #define __GFX_NXANIMCACHE_H__ 10 | 11 | #include 12 | #include 13 | 14 | namespace Gfx 15 | { 16 | class CBonedAnimFrameData; 17 | }; 18 | 19 | namespace Nx 20 | { 21 | 22 | Gfx::CBonedAnimFrameData* GetCachedAnim( uint32 animChecksum, bool assertOnFail = true ); 23 | 24 | } 25 | 26 | #endif // __GFX_NXANIMCACHE_H__ 27 | -------------------------------------------------------------------------------- /Code/Gfx/NxFontMan.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_2D_FONTMAN_H__ 2 | #define __GFX_2D_FONTMAN_H__ 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace Script 9 | { 10 | class CScriptStructure; 11 | class CScript; 12 | } 13 | 14 | namespace Nx 15 | { 16 | 17 | class CFontManager 18 | { 19 | public: 20 | static void sLoadFont(const char *pName, int charSpacing = 0, 21 | int spaceSpacing = 0, Image::RGBA *pColorTab = NULL, 22 | bool isButtonFont = false); 23 | static void sUnloadFont(const char *pName); 24 | static Nx::CFont * sGetFont(const char *pName); 25 | static Nx::CFont * sGetFont(uint32 checksum); 26 | 27 | static const char * sTestFontLoaded(uint32 checksum); 28 | 29 | static char sMapMetaCharacterToButton(const char *pMetaChar); 30 | 31 | private: 32 | // Constants 33 | enum { 34 | vMAX_FONT_ENTRIES = 16, 35 | NUM_META_BUTTON_ENTRIES = 32, 36 | }; 37 | 38 | 39 | struct FontEntry 40 | { 41 | enum { 42 | vMAX_NAME_SIZE = 24 43 | }; 44 | 45 | FontEntry() : mp_font(NULL) { } 46 | 47 | char mName[vMAX_NAME_SIZE]; 48 | Nx::CFont * mp_font; 49 | }; 50 | 51 | static FontEntry s_font_tab[vMAX_FONT_ENTRIES]; 52 | static Lst::HashTable s_font_lookup; 53 | 54 | static char s_meta_button_map[NUM_META_BUTTON_ENTRIES]; 55 | static bool s_meta_button_map_initialized; 56 | 57 | // The platform dependent calls 58 | static Nx::CFont * s_plat_load_font(const char *pName); 59 | static void s_plat_unload_font(Nx::CFont *pFont); 60 | }; 61 | 62 | 63 | 64 | bool ScriptLoadFont(Script::CScriptStructure *pParams, Script::CScript *pScript); 65 | bool ScriptUnloadFont(Script::CScriptStructure *pParams, Script::CScript *pScript); 66 | 67 | } 68 | 69 | #endif // FONTMAN 70 | -------------------------------------------------------------------------------- /Code/Gfx/NxSkinComponent.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: NxSkinComponent.h 4 | //* OWNER: Gary Jesdanun 5 | //* CREATION DATE: 12/21/2001 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_NXSKINCOMPONENT_H__ 9 | #define __GFX_NXSKINCOMPONENT_H__ 10 | 11 | #include 12 | 13 | namespace Nx 14 | { 15 | 16 | class CSkinComponent 17 | { 18 | 19 | public: 20 | // The basic interface to the skin component 21 | // this is the machine independent part 22 | // machine independent range checking, etc can go here 23 | CSkinComponent(); 24 | virtual ~CSkinComponent(); 25 | 26 | public: 27 | void SetColor(uint8 r, uint8 g, uint8 b, uint8 a); 28 | void SetVisibility(uint32 mask); 29 | void SetScale(float scaleFactor); 30 | void ReplaceTexture(char* p_srcFileName, char* p_dstFileName); 31 | 32 | protected: 33 | uint32 m_componentName; 34 | 35 | private: 36 | // The virtual functions will have a stub implementation 37 | // in p_nxskincomponent.cpp 38 | virtual void plat_set_color(uint8 r, uint8 g, uint8 b, uint8 a); 39 | virtual void plat_set_visibility(uint32 mask); 40 | virtual void plat_set_scale(float scaleFactor); 41 | virtual void plat_replace_texture(char* p_srcFileName, char* p_dstFileName); 42 | }; 43 | 44 | } 45 | 46 | #endif // __GFX_NXSKINCOMPONENT_H__ 47 | 48 | -------------------------------------------------------------------------------- /Code/Gfx/NxTextured3dPoly.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Nx 9 | { 10 | 11 | static Lst::HashTable< Nx::CTextured3dPoly > s_poly_table(1); 12 | 13 | void CTextured3dPoly::sRenderAll() 14 | { 15 | CTextured3dPoly *p_poly; 16 | s_poly_table.IterateStart(); 17 | while(( p_poly = s_poly_table.IterateNext())) 18 | { 19 | p_poly->Render(); 20 | } 21 | } 22 | 23 | CTextured3dPoly::CTextured3dPoly() 24 | { 25 | s_poly_table.PutItem((uint32)this,this); 26 | } 27 | 28 | CTextured3dPoly::~CTextured3dPoly() 29 | { 30 | s_poly_table.FlushItem((uint32)this); 31 | } 32 | 33 | void CTextured3dPoly::SetTexture(uint32 texture_checksum) 34 | { 35 | plat_set_texture(texture_checksum); 36 | } 37 | 38 | void CTextured3dPoly::SetTexture(const char *p_textureName) 39 | { 40 | SetTexture(Crc::GenerateCRCFromString(p_textureName)); 41 | } 42 | 43 | void CTextured3dPoly::SetPos(const Mth::Vector &pos, float width, float height, const Mth::Vector &normal, float angle) 44 | { 45 | Mth::Vector offx(1.0f,0.0f,0.0f); 46 | Mth::Vector offz=Mth::CrossProduct(normal,offx); 47 | 48 | offx*=width/2.0f; 49 | offz*=height/2.0f; 50 | 51 | mp_pos[0]=pos-offx-offz; 52 | mp_pos[1]=pos+offx-offz; 53 | mp_pos[2]=pos+offx+offz; 54 | mp_pos[3]=pos-offx+offz; 55 | } 56 | 57 | void CTextured3dPoly::Render() 58 | { 59 | plat_render(); 60 | } 61 | 62 | } // namespace Nx 63 | 64 | -------------------------------------------------------------------------------- /Code/Gfx/NxTextured3dPoly.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////// 2 | // NxTextured3dPoly.h - Neversoft Engine, Rendering portion, Platform independent interface 3 | 4 | #ifndef __GFX_NX_TEXTURED_3D_POLY_H__ 5 | #define __GFX_NX_TEXTURED_3D_POLY_H__ 6 | 7 | #ifndef __CORE_DEFINES_H 8 | #include 9 | #endif 10 | 11 | #ifndef __CORE_MATH_VECTOR_H 12 | #include 13 | #endif 14 | 15 | namespace Nx 16 | { 17 | 18 | // Class for displaying a single textured 3d poly. Currently used by the pedestrian shadows, which 19 | // are just simple circular textures oriented to the ground. 20 | class CTextured3dPoly 21 | { 22 | protected: 23 | Mth::Vector mp_pos[4]; 24 | 25 | public: 26 | CTextured3dPoly(); 27 | virtual ~CTextured3dPoly(); 28 | 29 | void SetTexture(const char *p_textureName); 30 | void SetTexture(uint32 texture_checksum); 31 | 32 | void SetPos(const Mth::Vector &pos, float width, float height, const Mth::Vector &normal, float angle=0.0f); 33 | 34 | void Render(); 35 | 36 | static void sRenderAll(); 37 | 38 | private: 39 | virtual void plat_render() {} 40 | virtual void plat_set_texture(uint32 texture_checksum) {} 41 | 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/BillboardScreenAlignedVS.vsh: -------------------------------------------------------------------------------- 1 | xvs.1.1 2 | 3 | ; Constants: 4 | ; c0 - c3 WVP Matrix (WORLD*VIEW*PROJECTION) 5 | ; c4 Screen right vector 6 | ; c5 Screen up vector 7 | ; c6 Screen at vector 8 | 9 | ; In: 10 | ; v0 - Position (actually the position of the pivot point) 11 | ; v1 - Normal (actually the position of the point relative to the pivot) 12 | ; v2 - Vertex color 13 | ; v3 - TexCoord0 14 | ; v4 - TexCoord1 15 | ; v5 - TexCoord2 16 | ; v6 - TexCoord3 17 | 18 | ; Out: 19 | ; oPos - Position 20 | ; oTn - TextureCoords 21 | 22 | ;------------------------------------------------------------------------------ 23 | ; Pivot relative position -> world relative position, plus copy texture coordinates 24 | ; (interleaving these helps prevent stalls) 25 | ;------------------------------------------------------------------------------ 26 | mul r0.xyz, v1.x, c4 27 | mov oT0, v3 28 | mad r0.xyz, v1.y, c5, r0 29 | mov oT1, v4 30 | mad r0.xyz, v1.z, c6, r0 31 | mov oT2, v5 32 | add r0.xyz, v0, r0 33 | mov oT3, v6 34 | sge r0.w, c0.x, c0.x ; Set r0.w = 1.0 35 | 36 | ;------------------------------------------------------------------------------ 37 | ; Vertex color 38 | ;------------------------------------------------------------------------------ 39 | mov oD0, v2 40 | 41 | ;------------------------------------------------------------------------------ 42 | ; Vertex->screen transform 43 | ;------------------------------------------------------------------------------ 44 | dp4 oPos.x, r0, c0 45 | dp4 oPos.y, r0, c1 46 | dp4 oPos.z, r0, c2 47 | dp4 oPos.w, r0, c3 48 | 49 | ;------------------------------------------------------------------------------ 50 | ; Deal with fog value (r12 shadows oPos)... 51 | ;------------------------------------------------------------------------------ 52 | mov oFog.x, -r12.w 53 | 54 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShader0.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | 3 | tex t0 4 | mul t0.rgb,t0.rgb,c0.rgb ; Modulate texture color0 with material color0 5 | mul_x4 r0.rgb,v0.rgb,t0.rgb ; Modulate (x4) resultant color with vertex color 6 | +mul_x2 r0.a,v0.a,t0.a ; Modulate (x2) result alpha with vertex alpha 7 | 8 | xfc prod, fog.rgb, sum, zero, 1 - fog.a, c4, r0.a 9 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShader0IVA.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | 3 | tex t0 4 | mul t0.rgb,t0.rgb,c0.rgb ; Modulate texture color0 with material color0 5 | mul_x4 r0.rgb,v0.rgb,t0.rgb ; Modulate (x4) resultant color with vertex color 6 | +mul_x2 r0.a,c4.a,t0.a ; Modulate (x2) result alpha with constant alpha 7 | 8 | xfc prod, fog.rgb, sum, zero, 1 - fog.a, c4, r0.a 9 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShader1.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | mul_x2 v0.rgb,v0.rgb,c0.rgb ; Modulate vertex color0 with material color0 3 | mov r0,v0 4 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShader2.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | tex t0 3 | mov r0,t0 4 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShader3.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | mov r0,c0 3 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShader4.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | tex t0 3 | mul_x2 r0,v0,t0 ; Modulate (x2) texture color with vertex color. 4 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShader5.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | mov r0,v0 ; Just use vertex color. 3 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShaderBrighten.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | 3 | tex t0 4 | ;mul t0.rgb,t0.rgb,c0.rgb ; Modulate texture color0 with material color0 5 | ;mul_x4 r0.rgb,v0.rgb,t0.rgb ; Modulate (x4) resultant color with vertex color 6 | ;mul_x2 r0.a,v0.a,t0.a ; Modulate (x2) result alpha with vertex alpha 7 | 8 | mul_x2 r0,v0.a,t0.a ; Modulate (x2) result alpha with vertex alpha and copy into all 4 channels 9 | 10 | xfc prod, fog.rgb, sum, zero, 1 - fog.a, c4, r0.a 11 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShaderBrightenIVA.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | 3 | tex t0 4 | ;mul t0.rgb,t0.rgb,c0.rgb ; Modulate texture color0 with material color0 5 | ;mul_x4 r0.rgb,v0.rgb,t0.rgb ; Modulate (x4) resultant color with vertex color 6 | ;+mul_x2 r0.a,c4.a,t0.a ; Modulate (x2) result alpha with constant alpha 7 | 8 | mul_x2 r0,c4.a,t0.a ; Modulate (x2) result alpha with constant alpha and copy into all 4 channels 9 | 10 | xfc prod, fog.rgb, sum, zero, 1 - fog.a, c4, r0.a 11 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShaderBumpWater.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | 3 | tex t0 4 | texbem t1, t0 5 | mul t1.rgb,t1.rgb,c0.rgb ; Modulate texture1 color with material color0 6 | mul_x4 r0.rgb,v0.rgb,t1.rgb ; Modulate (x4) resultant color with vertex color 7 | +mul_x2 r0.a,v0.a,t1.a ; Modulate (x2) result alpha with vertex alpha 8 | 9 | xfc prod, fog.rgb, sum, zero, 1 - fog.a, c4, r0.a 10 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShaderFocusBlur.psh: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ; 4-tap filtering 3 | ; Copyright (C) 2001 Microsoft Corporation 4 | ; All rights reserved. 5 | ;------------------------------------------------------------------------------ 6 | xps.1.1 7 | 8 | ; default filter is box filter, but this is easily overwritten using SetPixelShaderConstant 9 | 10 | ; When setting a pixel shader constant, we must check to see if the 11 | ; filter coefficient is negative, in which case we set the constant as a positive 12 | ; number and negate the constant in the expression below. 13 | def c0, 0.25f, 0.25f, 0.25f, 0.25f 14 | def c1, 0.25f, 0.25f, 0.25f, 0.25f 15 | def c2, 0.25f, 0.25f, 0.25f, 0.25f 16 | def c3, 0.25f, 0.25f, 0.25f, 0.25f 17 | 18 | ; source textures 19 | tex t0 20 | tex t1 21 | tex t2 22 | tex t3 23 | 24 | ; simple way 25 | ; mul r0, c0, t0 26 | ; mad r0, c1, t1, r0 27 | ; mad r0, c2, t2, r0 28 | ; mad r0, c3, t3, r0 29 | 30 | ; This has better precision (assuming the xmma_x2 intermediates don't overflow): 31 | xmma_x2 discard, discard, r0, c0, t0, c1, t1 ; 2 * (c0 * t0 + c1 * t1) 32 | xmma_x2 discard, discard, r1, c2, t2, c3, t3 ; 2 * (c2 * t2 + c3 * t3) 33 | add_d2 r0, r0, r1 34 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShaderFocusIntegrate.psh: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ; Depth of field by choosing a range of z values and using that to select 3 | ; a blurred version of the original image. 4 | ; 5 | ; Copyright (C) 2001 Microsoft Corporation 6 | ; All rights reserved. 7 | ;------------------------------------------------------------------------------ 8 | xps.1.1 9 | 10 | ; override with SetPixelShaderConstant 11 | def c0, 0.f, 0.f, 0.f, 0.f ; offset 12 | def c1, 0.f, 0.f, 1.f, 0.f ; slope x1 13 | def c2, 0.f, 0.f, 0.f, 0.f ; slope x4 14 | def c3, 0.f, 0.f, 0.f, 1.f ; slope x16 15 | def c4, 1.f, 1.f, 1.f, 0.498039215 ; 0x7f 16 | 17 | ; source textures 18 | tex t0 ; z-buffer texture 19 | tex t1 ; pre-blurred texture 20 | 21 | ; get the range of active z values 22 | sub r0, t0, c0 ; offset 23 | mul_x4 r1, c3, r0 ; scale x16 24 | mad_x4 r1, c2, r0, r1 ; scale x4 25 | mad r1, c1, r0, r1 ; scale x1 26 | sub r0.a, r1.a, c4.a ; subtract 0x7f from r1.a 27 | cnd r0.a, r0.a, zero.a, r1.b ; keep blue only if r1.a is not 0xff 28 | add r1.a, r1.a, r0.a ; add alpha + blue, the desired range is now mapped to [0,1] 29 | mul r1.a, r1_bx2.a, r1_bx2.a ; convert to -1,1 range and square to get parabola 30 | 31 | ; modulate pre-blurred texture by depth range 32 | xfc r1.a, t1, zero, zero, zero, zero, r1.a 33 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShaderFocusLookupIntegrate.psh: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ; FocusBlur by choosing a range of z values and using that to select 3 | ; a blurred version of the original image. 4 | ; 5 | ; Copyright (C) 2001 Microsoft Corporation 6 | ; All rights reserved. 7 | ;------------------------------------------------------------------------------ 8 | xps.1.1 9 | 10 | def c0, 0.5f, 0.5f, 0.5f, 0.5f ; blur value 11 | 12 | ; source textures 13 | tex t0 ; z-buffer texture 14 | texreg2ar t1, t0 ; lookup-table texture to choose what range of depth to use 15 | tex t2 ; pre-blurred texture, first offset 16 | tex t3 ; pre-blurred texture, second offset 17 | 18 | ; blur pre-blurred texture even more 19 | lrp r0, c0, t2, t3 20 | 21 | ; modulate by depth range 22 | xfc r0_sat, 1-t1.a, zero, zero, zero, zero, 1-t1.a 23 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShaderNULL.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | def c7, 1.0f, 1.0f, 1.0f, 1.0f 3 | mov r0, c7 4 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShaderPointSprite.psh: -------------------------------------------------------------------------------- 1 | xps.1.1 2 | tex t3 3 | mul_x2 r0,v0,t3 ; Modulate (x2) texture color with vertex color. 4 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/PixelShader_ShadowBuffer.psh: -------------------------------------------------------------------------------- 1 | ; Shadow buffer pixel shader. 2 | ; On entry: 3 | ; c0 contains the base percentage of color (even in shadow), 4 | ; c1 contains the percentage of color that shadow affects. 5 | 6 | xps.1.1 7 | 8 | tex t3 ; get shadow from light 9 | 10 | mul r1, c1, t3 ; Use the shadow buffer to affect the shadow portion of the color change 11 | add r0, c0, r1 ; Add to the base color to get final color 12 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/ShadowBufferStaticGeomPS.psh: -------------------------------------------------------------------------------- 1 | ;Shadowbuffer pixel shader. 2 | 3 | xps.1.1 4 | 5 | def c7, 0.6f, 0.6f, 0.6f, 0.0f 6 | 7 | tex t0 ; Base geometry texture (for alpha modulation). 8 | tex t1 ; Shadow depth buffer texture. 9 | 10 | ; White texture (outside of skater) we don't want to draw - so negate blue component into alpha. 11 | ; This way the white part of the texture will have zero alpha, the black part will have full alpha. 12 | 13 | mul r0.a, 1-t1.b, t0.a ; Modulate shadow alpha with base texture alpha (to neatly deal with holes in texture). 14 | +add r0.rgb, t1.rgb, c7.rgb ; Add in the ambient component to brighten up the shadow a bit. 15 | 16 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/ShadowBufferStaticGeomVS.vsh: -------------------------------------------------------------------------------- 1 | xvs.1.1 2 | 3 | ; Constants: 4 | ; c0 - c3 - WVP Matrix (WORLD*VIEW*PROJECTION) 5 | ; c4 - c7 - WT Matrix (WORLD*TEXTURETRANSFORM) 6 | ; c8 - local space light position. 7 | 8 | ; In: 9 | ; v0 - Position 10 | ; v1 - Vertex color 11 | ; v2 - TexCoord0 12 | 13 | ; Out: 14 | ; oPos - Position 15 | ; oTn - TextureCoords 16 | 17 | ;vertex->screen 18 | dp4 oPos.x, v0, c0 19 | dp4 oPos.y, v0, c1 20 | dp4 oPos.z, v0, c2 21 | dp4 oPos.w, v0, c3 22 | 23 | ;diffuse lighting (not necessary for our purposes) 24 | ;add r0,c8,-v0 25 | ;dp3 r0.w,r0,r0 26 | ;rsq r1.x,r0.w 27 | ;mul r0,r0,r1.x 28 | ;dp3 oD0,v1,r0 29 | 30 | ;decal texture 31 | mov oT0, v2 32 | 33 | ;vertex->shadowbuffer texcoords 34 | dp4 oT1.x, v0, c4 35 | dp4 oT1.y, v0, c5 36 | dp4 oT1.z, v0, c6 37 | dp4 r0.w, v0, c7 38 | 39 | ;clamp w (q) to 0 40 | slt r1, c0, c0 41 | max r0.w, r0.w, r1.w 42 | mov oT1.w, r0.w 43 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/anim.h: -------------------------------------------------------------------------------- 1 | #ifndef __ANIM_H 2 | #define __ANIM_H 3 | 4 | extern DWORD WeightedMeshVS_VXC_1Weight; 5 | extern DWORD WeightedMeshVS_VXC_2Weight; 6 | extern DWORD WeightedMeshVS_VXC_3Weight; 7 | extern DWORD WeightedMeshVS_VXC_Specular_1Weight; 8 | extern DWORD WeightedMeshVS_VXC_Specular_2Weight; 9 | extern DWORD WeightedMeshVS_VXC_Specular_3Weight; 10 | extern DWORD WeightedMeshVS_VXC_1Weight_UVTransform; 11 | extern DWORD WeightedMeshVS_VXC_2Weight_UVTransform; 12 | extern DWORD WeightedMeshVS_VXC_3Weight_UVTransform; 13 | extern DWORD WeightedMeshVS_VXC_1Weight_SBPassThru; 14 | extern DWORD WeightedMeshVS_VXC_2Weight_SBPassThru; 15 | extern DWORD WeightedMeshVS_VXC_3Weight_SBPassThru; 16 | extern DWORD WeightedMeshVertexShader_SBWrite; 17 | extern DWORD BillboardScreenAlignedVS; 18 | extern DWORD ParticleFlatVS; 19 | extern DWORD ParticleNewFlatVS; 20 | extern DWORD ParticleNewFlatPointSpriteVS; 21 | extern DWORD ShadowBufferStaticGeomVS; 22 | 23 | namespace NxXbox 24 | { 25 | 26 | DWORD GetVertexShader( bool vertex_colors, bool specular, uint32 max_weights_used ); 27 | void CreateWeightedMeshVertexShaders( void ); 28 | void startup_weighted_mesh_vertex_shader( void ); 29 | void setup_weighted_mesh_vertex_shader( void *p_root_matrix, void *p_bone_matrices, int num_bone_matrices ); 30 | void shutdown_weighted_mesh_vertex_shader( void ); 31 | 32 | 33 | } // namespace NxXbox 34 | 35 | #endif // __ANIM_H 36 | 37 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/gamma.h: -------------------------------------------------------------------------------- 1 | #ifndef __GAMMA_H__ 2 | #define __GAMMA_H__ 3 | 4 | namespace NxXbox 5 | { 6 | void SetGammaNormalized( float fr, float fg, float fb ); 7 | void GetGammaNormalized( float *fr, float *fg, float *fb ); 8 | } 9 | 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/nx_init.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gfx/XBox/NX/nx_init.cpp -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/occlude.h: -------------------------------------------------------------------------------- 1 | #ifndef __OCCLUDE_H__ 2 | #define __OCCLUDE_H__ 3 | 4 | namespace NxXbox 5 | { 6 | void AddOcclusionPoly( Mth::Vector &v0, Mth::Vector &v1, Mth::Vector &v2, Mth::Vector &v3, uint32 checksum = 0 ); 7 | void EnableOcclusionPoly( uint32 checksum, bool available ); 8 | void RemoveAllOcclusionPolys( void ); 9 | void BuildOccluders( Mth::Vector *p_cam_pos, int view ); 10 | bool TestSphereAgainstOccluders( D3DXVECTOR3 *p_center, float radius, uint32 meshes = 1 ); 11 | } 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/particles.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __PARTICLE_H__ 3 | #define __PARTICLE_H__ 4 | 5 | #include "gfx\xbox\nx\scene.h" 6 | 7 | namespace NxXbox 8 | { 9 | 10 | enum eParticleType 11 | { 12 | PARTICLE_TYPE_LINE, 13 | PARTICLE_TYPE_FLAT, 14 | PARTICLE_TYPE_SHADED, 15 | PARTICLE_TYPE_SMOOTH, 16 | PARTICLE_TYPE_GLOW, 17 | PARTICLE_TYPE_STAR, 18 | PARTICLE_TYPE_SMOOTHSTAR, 19 | PARTICLE_TYPE_RIBBON, 20 | PARTICLE_TYPE_SMOOTHRIBBON, 21 | PARTICLE_TYPE_RIBBONTRAIL, 22 | PARTICLE_TYPE_GLOWRIBBONTRAIL, 23 | }; 24 | 25 | 26 | struct sParticleSystem 27 | { 28 | public: 29 | sParticleSystem( uint32 max_particles, eParticleType type, uint32 texture_checksum, uint32 blendmode_checksum, int fix, int num_segments = 0, int history = 0 ); 30 | ~sParticleSystem( void ); 31 | 32 | sMaterial *mp_material; 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/screenfx.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCREENFX_H 2 | #define __SCREENFX_H 3 | 4 | namespace NxXbox 5 | { 6 | void start_screen_blur( void ); 7 | void finish_screen_blur( void ); 8 | 9 | void start_focus_blur( void ); 10 | void finish_focus_blur( void ); 11 | void set_focus_blur_focus( Mth::Vector & focal_point, float offset, float near_depth, float far_depth ); 12 | 13 | void draw_rain( void ); 14 | } // namespace NxXbox 15 | 16 | #endif // __SCREENFX_H 17 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/sprite.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPRITE_H 2 | #define __SPRITE_H 3 | 4 | #include "texture.h" 5 | 6 | namespace NxXbox 7 | { 8 | 9 | struct SDraw2D 10 | { 11 | SDraw2D( float pri = 0.0f, bool hide = true ); 12 | virtual ~SDraw2D( void ); 13 | 14 | void SetPriority( float pri ); 15 | float GetPriority( void ) const; 16 | void SetZValue( float z ); 17 | float GetZValue( void ) { return m_zvalue; } 18 | 19 | void SetHidden( bool hide ); 20 | bool IsHidden( void ) const; 21 | 22 | // members 23 | SDraw2D *mp_next; 24 | 25 | // Statics 26 | static void DrawAll( void ); 27 | 28 | private: 29 | void InsertDrawList( void ); 30 | void RemoveDrawList( void ); 31 | 32 | virtual void BeginDraw( void ) = 0; 33 | virtual void Draw( void ) = 0; 34 | virtual void EndDraw( void ) = 0; 35 | 36 | // Not even the derived classes should have direct access 37 | bool m_hidden; 38 | float m_pri; 39 | float m_zvalue; 40 | 41 | // 2D draw list (sorted by priority); 42 | static SDraw2D *sp_2D_draw_list; 43 | }; 44 | 45 | 46 | struct sSprite : public SDraw2D 47 | { 48 | public: 49 | sSprite( float pri = 0.0f ); 50 | ~sSprite(); 51 | 52 | sTexture *mp_texture; 53 | 54 | float m_xpos; 55 | float m_ypos; 56 | uint16 m_width; 57 | uint16 m_height; 58 | float m_scale_x; 59 | float m_scale_y; 60 | float m_xhot; 61 | float m_yhot; 62 | float m_rot; 63 | uint32 m_rgba; 64 | 65 | private: 66 | 67 | void BeginDraw(); 68 | void Draw(); 69 | void EndDraw(void); 70 | }; 71 | 72 | 73 | } // namespace NxXbox 74 | 75 | 76 | #endif // __SPRITE_H 77 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/NX/texture.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEXTURE_H 2 | #define __TEXTURE_H 3 | 4 | #include 5 | 6 | namespace NxXbox 7 | { 8 | 9 | struct sTexture 10 | { 11 | sTexture(); 12 | ~sTexture(); 13 | 14 | bool SetRenderTarget( int width, int height, int depth, int z_depth ); 15 | void Set( int pass ); 16 | 17 | uint32 Checksum; 18 | uint16 BaseWidth, BaseHeight; // The size of the D3D texture (will be power of 2). 19 | uint16 ActualWidth, ActualHeight; // The size of the texture itself (may not be power of 2). 20 | 21 | uint8 Levels; 22 | uint8 TexelDepth; 23 | uint8 PaletteDepth; 24 | uint8 DXT; 25 | 26 | IDirect3DTexture8* pD3DTexture; 27 | IDirect3DPalette8* pD3DPalette; 28 | IDirect3DSurface8* pD3DSurface; 29 | }; 30 | 31 | sTexture *LoadTexture( const char *p_filename ); 32 | 33 | } // namespace NxXbox 34 | 35 | #endif // __TEXTURE_H 36 | 37 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_NxSprite.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxScene.h 3 | 4 | #ifndef __GFX_P_NX_SPRITE_H__ 5 | #define __GFX_P_NX_SPRITE_H__ 6 | 7 | #include "Gfx/NxSprite.h" 8 | #include "Gfx/xbox/NX/texture.h" 9 | #include "Gfx/xbox/NX/sprite.h" 10 | 11 | namespace Nx 12 | { 13 | 14 | ///////////////////////////////////////////////////////////////////////////////////// 15 | // Private classes 16 | // 17 | // Machine specific implementation of the CSprite 18 | class CXboxSprite : public CSprite 19 | { 20 | public: 21 | CXboxSprite(); 22 | virtual ~CXboxSprite(); 23 | 24 | private: // It's all private, as it is machine specific 25 | virtual void plat_initialize(); 26 | 27 | virtual void plat_update_hidden(); // Tell engine of update 28 | virtual void plat_update_engine(); // Update engine primitives 29 | virtual void plat_update_priority(); 30 | 31 | NxXbox::sSprite * mp_plat_sprite; 32 | }; 33 | 34 | } // Namespace Nx 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_NxTextured3dPoly.cpp: -------------------------------------------------------------------------------- 1 | #include "Gfx/Xbox/p_NxTextured3dPoly.h" 2 | 3 | namespace Nx 4 | { 5 | 6 | //////////////////////////////////////////////////////////////////////////////////// 7 | // Here's a machine specific implementation of CTextured3dPoly 8 | 9 | CXboxTextured3dPoly::CXboxTextured3dPoly( void ) 10 | { 11 | } 12 | 13 | CXboxTextured3dPoly::~CXboxTextured3dPoly( void ) 14 | { 15 | } 16 | 17 | void CXboxTextured3dPoly::plat_render( void ) 18 | { 19 | } 20 | 21 | } // Namespace NxXbox 22 | 23 | 24 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_NxTextured3dPoly.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_P_NX_TEXTURED_3D_POLY_H__ 2 | #define __GFX_P_NX_TEXTURED_3D_POLY_H__ 3 | 4 | #include 5 | 6 | namespace Nx 7 | { 8 | 9 | // Machine specific implementation of CTextured3dPoly 10 | class CXboxTextured3dPoly : public Nx::CTextured3dPoly 11 | { 12 | public: 13 | CXboxTextured3dPoly(); 14 | virtual ~CXboxTextured3dPoly(); 15 | private: 16 | virtual void plat_render(); 17 | }; 18 | 19 | } // namespace NxXbox 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_NxViewMan.cpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // p_NxViewMan.cpp - Xbox platform specific interface to CViewportManager 3 | 4 | #include 5 | 6 | #include "gfx/NxViewMan.h" 7 | #include "gfx/Xbox/p_NxViewport.h" 8 | 9 | namespace Nx 10 | { 11 | 12 | 13 | ///////////////////////////////////////////////////////////////////////////////////// 14 | ///////////////////////////////////////////////////////////////////////////////////// 15 | // Functions 16 | 17 | 18 | /******************************************************************/ 19 | /* */ 20 | /* */ 21 | /******************************************************************/ 22 | CViewport *CViewportManager::s_plat_create_viewport( const Mth::Rect *rect, Gfx::Camera *cam ) 23 | { 24 | return new CXboxViewport( rect, cam ); 25 | } 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_NxViewport.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxViewport.h 3 | 4 | #ifndef __GFX_P_NX_VIEWPORT_H__ 5 | #define __GFX_P_NX_VIEWPORT_H__ 6 | 7 | #include "Gfx/NxViewport.h" 8 | 9 | namespace Nx 10 | { 11 | 12 | ///////////////////////////////////////////////////////////////////////////////////// 13 | // Private classes 14 | // 15 | // Machine specific implementation of the CViewport 16 | class CXboxViewport : public CViewport 17 | { 18 | public: 19 | CXboxViewport(); 20 | CXboxViewport( const Mth::Rect *rect, Gfx::Camera *cam = NULL ); 21 | virtual ~CXboxViewport(); 22 | 23 | private: // It's all private, as it is machine specific 24 | // virtual void plat_initialize(); 25 | virtual float plat_transform_to_screen_coord( const Mth::Vector & world_pos, float & screen_pos_x, float & screen_pos_y, ZBufferValue & screen_pos_z ); 26 | 27 | }; 28 | 29 | } // Namespace Nx 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_NxWin2D.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxWin2D.h 3 | 4 | #ifndef __GFX_P_NX_WIN2D_H__ 5 | #define __GFX_P_NX_WIN2D_H__ 6 | 7 | #include "Gfx/NxWin2D.h" 8 | #include "Gfx/Xbox/NX/sprite.h" 9 | 10 | namespace Nx 11 | { 12 | 13 | ///////////////////////////////////////////////////////////////////////////////////// 14 | // Private classes 15 | // 16 | 17 | ///////////////////////////////////////////////////////////////////////////////////// 18 | // Here's a machine specific implementation of the CWindow2D 19 | class CXboxWindow2D : public CWindow2D 20 | { 21 | public: 22 | CXboxWindow2D( int x = 0, int y = 0, int width = 640, int height = 480 ); 23 | CXboxWindow2D( const Mth::Rect & win_rect); 24 | virtual ~CXboxWindow2D(); 25 | 26 | private: 27 | // 28 | virtual void plat_update_engine(); // Update engine primitives 29 | }; 30 | 31 | } // Namespace Nx 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_memview.h: -------------------------------------------------------------------------------- 1 | //// 2 | 3 | #ifndef __P_MEMVIEW_H__ 4 | #define __P_MEMVIEW_H__ 5 | 6 | void MemView_Display(); 7 | void MemView_Input(uint buttons, uint makes, uint breaks); 8 | void MemView_Alloc( void *v); 9 | void MemView_Free( void *v); 10 | void MemViewToggle(); 11 | void MemView_FindLeaks(); 12 | int DumpUnwindStack( int iMaxDepth, int *pDest ); 13 | char *MemView_GetFunctionName(int pc, int *p_size); 14 | void MemView_DumpFragments(Mem::Heap *pHeap); 15 | void MemView_AnalyzeBlocks(uint32 mask = 0); 16 | void MemView_MarkBlocks(uint32 flags = 1 ); 17 | void MemView_DumpHeap(Mem::Heap *pHeap); 18 | void MemView_AnalyzeHeap(Mem::Heap *pHeap); 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_nx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Gfx/XBox/p_nx.cpp -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_nxparticle.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: p_nxParticle.h 4 | //* OWNER: Dave Cowling 5 | //* CREATION DATE: 3/27/2002 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_P_NX_PARTICLE_H__ 9 | #define __GFX_P_NX_PARTICLE_H__ 10 | 11 | #include "gfx/nxparticle.h" 12 | #include "gfx/xbox/nx/particles.h" 13 | 14 | namespace Nx 15 | { 16 | 17 | /******************************************************************/ 18 | /* */ 19 | /* */ 20 | /******************************************************************/ 21 | 22 | } // Nx 23 | 24 | #endif 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_nxscene.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // p_NxScene.h 3 | 4 | #ifndef __GFX_P_NX_SCENE_H__ 5 | #define __GFX_P_NX_SCENE_H__ 6 | 7 | #include "Gfx/Nx.h" 8 | #include "Gfx/xbox/nx/scene.h" 9 | 10 | namespace Nx 11 | { 12 | 13 | ///////////////////////////////////////////////////////////////////////////////////// 14 | // Private classes 15 | // 16 | // Here's a machine specific implementation of the CScene 17 | class CXboxScene : public CScene 18 | { 19 | public: 20 | 21 | CXboxScene( int sector_table_size = 10 ); 22 | NxXbox::sScene * GetEngineScene() const { return mp_engine_scene; } 23 | void SetEngineScene( NxXbox::sScene *p_scene ) { mp_engine_scene = p_scene; } 24 | void DestroySectorMeshes( void ); 25 | 26 | private: // It's all private, as it is machine specific 27 | virtual void plat_post_load(); 28 | virtual bool plat_load_textures( const char *p_name ); // load textures 29 | virtual bool plat_load_collision( const char *p_name ); // load collision data 30 | virtual bool plat_unload_add_scene( void ); 31 | virtual CSector * plat_create_sector(); // empty sector 32 | 33 | 34 | NxXbox::sScene *mp_engine_scene; 35 | 36 | }; 37 | 38 | } // Namespace Nx 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Code/Gfx/XBox/p_nxsector.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFX_P_NX_SECTOR_H__ 2 | #define __GFX_P_NX_SECTOR_H__ 3 | 4 | #include 5 | #include 6 | #include "gfx\NxSector.h" 7 | #include "gfx\Image\ImageBasic.h" 8 | 9 | #include "gfx\xbox\p_nxscene.h" 10 | #include "gfx\xbox\nx\mesh.h" 11 | 12 | namespace Nx 13 | { 14 | 15 | ///////////////////////////////////////////////////////////////////////////////////// 16 | // Private classes 17 | // 18 | // Here's a machine specific implementation of the CSector 19 | class CXboxSector : public CSector 20 | { 21 | public: 22 | CXboxSector(); 23 | 24 | bool LoadFromFile( void* p_file ); 25 | bool LoadFromMemory( void **p_mem ); 26 | 27 | NxXbox::sScene *GenerateScene( void ); 28 | 29 | private: // It's all private, as it is machine specific 30 | virtual void plat_set_color( Image::RGBA rgba ); 31 | virtual void plat_clear_color( void ); 32 | virtual void plat_set_visibility( uint32 mask ); 33 | virtual void plat_set_active( bool on ); 34 | virtual void plat_set_world_position( const Mth::Vector& pos ); 35 | virtual const Mth::CBBox &plat_get_bounding_box( void ) const; 36 | virtual const Mth::Vector &plat_get_world_position( void ) const; 37 | virtual void plat_set_shatter( bool on ); 38 | virtual CSector *plat_clone( bool instance, CScene *p_scene = NULL ); 39 | 40 | int m_flags; 41 | 42 | Mth::Vector m_pos_offset; 43 | 44 | Image::RGBA m_rgba; 45 | }; 46 | 47 | } // Namespace Nx 48 | 49 | #endif -------------------------------------------------------------------------------- /Code/Gfx/nxparticlemgr.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Gfx 3 | //* FILENAME: p_nxParticleMgr.h 4 | //* OWNER: Paul Robinson 5 | //* CREATION DATE: 3/27/2002 6 | //**************************************************************************** 7 | 8 | #ifndef __GFX_P_NX_PARTICLE_MGR_H__ 9 | #define __GFX_P_NX_PARTICLE_MGR_H__ 10 | 11 | #include "gfx/nxparticle.h" 12 | 13 | namespace Nx 14 | { 15 | 16 | void process_particles( float delta_time ); 17 | void render_particles( void ); 18 | CParticle* get_particle( uint32 checksum ); 19 | CParticle* create_particle( uint32 checksum, uint32 type_checksum, int max_particles, int max_streams, uint32 texture_checksum, uint32 blendmode_checksum, int fix, int num_segments, float split, int history, int perm ); 20 | void destroy_particle( uint32 checksum ); 21 | void destroy_particle_when_empty( uint32 checksum ); 22 | void destroy_all_particles( ); 23 | void destroy_all_temp_particles( ); 24 | 25 | void plat_process_particles( float delta_time ); 26 | CParticle* plat_get_particle( uint32 checksum ); 27 | CParticle* plat_create_particle( uint32 checksum, uint32 type_checksum, int max_particles, int max_streams, uint32 texture_checksum, uint32 blendmode_checksum, int fix, int num_segments, float split, int history ); 28 | } // Nx 29 | 30 | #endif 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Code/Gfx/stdafx.h: -------------------------------------------------------------------------------- 1 | // You cannot conditionally compile-out stdafx.h in the PC project 2 | // so the only recourse is to always include "stdafx.h" in both 3 | // projects and to include this dummy version on the PS2 project 4 | -------------------------------------------------------------------------------- /Code/Sk/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sk/.DS_Store -------------------------------------------------------------------------------- /Code/Sk/Engine/contact.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __ENGINE_CONTACT_H__ 3 | #define __ENGINE_CONTACT_H__ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | class CContact 10 | { 11 | public: 12 | CContact(); 13 | CContact(Obj::CCompositeObject *p_moving_object); 14 | 15 | bool ObjectExists(); // returns false if object has been deleted, or is "dead" or "inactive" 16 | bool Update(const Mth::Vector &pos); // Update the position, return false if object no longer exists 17 | const Mth::Vector & GetMovement() const; // get movement vector of the contact point for this frame 18 | const Mth::Matrix & GetRotation() const; // get rotation matrix for this frame 19 | bool IsRotated() const; 20 | 21 | private: 22 | Obj::CSmtPtr mp_moving_object; 23 | Mth::Matrix m_object_last_matrix; // The object's last orientation 24 | Mth::Vector m_object_last_pos; // The object's last position 25 | 26 | Mth::Vector m_movement; 27 | Mth::Matrix m_rotation; 28 | 29 | bool m_rotated; // set if it was rotated 30 | 31 | public: 32 | Obj::CCompositeObject* GetObject() {return mp_moving_object.Convert();} // return the object we are in contact with 33 | 34 | 35 | }; 36 | 37 | inline const Mth::Vector & CContact::GetMovement() const 38 | { 39 | return m_movement; 40 | } 41 | 42 | inline bool CContact::IsRotated() const 43 | { 44 | return m_rotated; 45 | } 46 | 47 | inline const Mth::Matrix & CContact::GetRotation() const 48 | { 49 | return m_rotation; 50 | 51 | } 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /Code/Sk/GameNet/Ngps/p_ezmain.h: -------------------------------------------------------------------------------- 1 | /* 2 | // ------------------------------------------------------------------------ 3 | 4 | File: main.h 5 | 6 | headers for EE library components. 7 | 8 | // ------------------------------------------------------------------------ 9 | */ 10 | 11 | #ifndef _MAIN_H 12 | #define _MAIN_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | 30 | // only present after 2.4.0 31 | // manually define SCE_LIBRARY_VERSION if necessary. 32 | #if (0) 33 | #define SCE_LIBRARY_VERSION 0x2340 34 | #else 35 | #include 36 | #endif 37 | 38 | #include "p_netcnfif.h" 39 | 40 | #include "p_ezcommon.h" 41 | #include "p_ezconfig.h" 42 | //#include "util.h" 43 | #include "p_libezcnf.h" 44 | //#include "libezctl.h" 45 | //#include "trc_hdd.h" 46 | 47 | 48 | #endif // _MAIN_H 49 | -------------------------------------------------------------------------------- /Code/Sk/GameNet/Ngps/p_libezcnf.h: -------------------------------------------------------------------------------- 1 | /* 2 | // ------------------------------------------------------------------------ 3 | 4 | File: libezcnf.h 5 | 6 | headers for libezcnf.c 7 | 8 | // ------------------------------------------------------------------------ 9 | */ 10 | 11 | #ifndef _LIBEZCNF_H 12 | #define _LIBEZCNF_H 13 | 14 | int initEzNetCnf(void); 15 | int exitEzNetCnf(void); 16 | 17 | int ezNetCnfGetCount(const char *, ezNetCnfType); 18 | int ezNetCnfGetCombinationList(char *, ezNetCnfCombinationList_t *); 19 | ezNetCnfCombination_t *ezNetCnfGetCombination(ezNetCnfCombinationList_t *, int); 20 | ezNetCnfCombination_t *ezNetCnfGetDefault(ezNetCnfCombinationList_t *); 21 | int ezNetCnfGetEnvData(char *, char *, sceNetcnfifData_t *); 22 | 23 | #endif // _LIBEZCNF_H 24 | 25 | -------------------------------------------------------------------------------- /Code/Sk/GameNet/Ngps/p_netcnfif.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sk/GameNet/Ngps/p_netcnfif.h -------------------------------------------------------------------------------- /Code/Sk/GameNet/ServerList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sk/GameNet/ServerList.cpp -------------------------------------------------------------------------------- /Code/Sk/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sk/Main.cpp -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/BettingGuy.h: -------------------------------------------------------------------------------- 1 | // BettingGuy.h 2 | #ifndef _SK_MODULES_SKATE_BETTINGGUY_H_ 3 | #define _SK_MODULES_SKATE_BETTINGGUY_H_ 4 | 5 | #include 6 | 7 | #include 8 | 9 | namespace Game 10 | { 11 | 12 | class CBettingGuy : public CGoal 13 | { 14 | public: 15 | CBettingGuy( Script::CStruct* pParams ); 16 | virtual ~CBettingGuy(); 17 | 18 | bool IsActive(); 19 | bool ShouldUseTimer() { return false; } 20 | bool CountAsActive() { return false; } 21 | bool Activate(); 22 | void SetActive(); 23 | bool Update(); 24 | bool MoveToNewNode( bool force = false ); 25 | bool IsExpired(); 26 | bool Deactivate( bool force = false, bool affect_tree = true ); 27 | bool Win(); 28 | bool Win( uint32 goalId ); 29 | bool Lose(); 30 | void Reset(); 31 | 32 | bool EndBetAttempt( uint32 goalId ); 33 | bool StartBetAttempt( uint32 goalId ); 34 | bool BetIsActive( uint32 goalId ); 35 | 36 | void OfferMade(); 37 | void OfferRefused(); 38 | void OfferAccepted(); 39 | 40 | Script::CStruct* GetBetParams(); 41 | void SetupParams(); 42 | 43 | protected: 44 | bool m_shouldMove; 45 | int m_numBetsWon; 46 | uint32 m_currentMinigame; 47 | uint32 m_currentNode; 48 | int m_currentDifficulty; 49 | bool m_hasOffered; 50 | bool m_inAttempt; 51 | int m_numTries; 52 | int m_currentChallenge; 53 | int m_betAmount; 54 | int m_straightLosses; 55 | int m_straightWins; 56 | }; 57 | 58 | } // namespace Game 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/CATGoal.cpp: -------------------------------------------------------------------------------- 1 | // Create-A-Trick goal! 2 | 3 | #include 4 | #include 5 | 6 | namespace Game 7 | { 8 | 9 | /******************************************************************/ 10 | /* */ 11 | /* */ 12 | /******************************************************************/ 13 | 14 | CCatGoal::CCatGoal( Script::CStruct* pParams ) : CGoal( pParams ) 15 | { 16 | // uh... 17 | } 18 | 19 | /******************************************************************/ 20 | /* */ 21 | /* */ 22 | /******************************************************************/ 23 | 24 | CCatGoal::~CCatGoal() 25 | { 26 | // hmm... 27 | } 28 | 29 | /******************************************************************/ 30 | /* */ 31 | /* */ 32 | /******************************************************************/ 33 | bool CCatGoal::Activate() 34 | { 35 | return CGoal::Activate(); 36 | } 37 | 38 | /******************************************************************/ 39 | /* */ 40 | /* */ 41 | /******************************************************************/ 42 | 43 | bool CCatGoal::Deactivate( bool force, bool affect_tree ) 44 | { 45 | return CGoal::Deactivate( force, affect_tree ); 46 | } 47 | 48 | 49 | } // namespace game 50 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/CATGoal.h: -------------------------------------------------------------------------------- 1 | // Create-A-Trick goal! 2 | 3 | #ifndef __SK_MODULES_SKATE_CATGOAL_H__ 4 | #define __SK_MODULES_SKATE_CATGOAL_H__ 5 | 6 | #ifndef __CORE_DEFINES_H 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | namespace Game 13 | { 14 | 15 | class CCatGoal : public CGoal 16 | { 17 | 18 | public: 19 | CCatGoal( Script::CStruct* pParams ); 20 | virtual ~CCatGoal(); 21 | 22 | bool Activate(); 23 | bool Deactivate( bool force = false, bool affect_tree = true ); 24 | protected: 25 | }; 26 | 27 | } 28 | 29 | #endif // #ifndef __SK_MODULES_SKATE_FINDGAPSGOAL_H__ 30 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/CompetitionGoal.h: -------------------------------------------------------------------------------- 1 | #ifndef __SK_MODULES_SKATE_COMPETITIONGOAL_H__ 2 | #define __SK_MODULES_SKATE_COMPETITIONGOAL_H__ 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | #include 9 | 10 | namespace Game 11 | { 12 | 13 | 14 | class CCompetitionGoal : public CGoal 15 | { 16 | 17 | public: 18 | CCompetitionGoal( Script::CStruct* pParams ); 19 | virtual ~CCompetitionGoal(); 20 | 21 | void Expire(); 22 | bool IsActive(); 23 | void SetActive(); 24 | void SetInactive(); 25 | 26 | void LoadSaveData( Script::CStruct* pFlags ); 27 | void GetSaveData( Script::CStruct* pFlags ); 28 | 29 | bool Win(); 30 | bool HasWonGoal(); 31 | void MarkBeaten(); 32 | bool UnBeatGoal(); 33 | 34 | void AwardCash( Script::CStruct* p_reward_params ); 35 | 36 | void PauseCompetition(); 37 | void UnPauseCompetition(); 38 | 39 | bool IsPaused(); 40 | protected: 41 | 42 | bool m_compPaused; 43 | bool m_gotGold; 44 | bool m_gotSilver; 45 | bool m_gotBronze; 46 | int m_rewardGiven; 47 | }; 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/FilmGoal.h: -------------------------------------------------------------------------------- 1 | // film goal. 2 | 3 | #ifndef __SK_MODULES_SKATE_FILMGOAL_H__ 4 | #define __SK_MODULES_SKATE_FILMGOAL_H__ 5 | 6 | #ifndef __CORE_DEFINES_H 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | namespace Game 13 | { 14 | 15 | class CFilmGoal : public CGoal 16 | { 17 | 18 | public: 19 | CFilmGoal( Script::CStruct* pParams ); 20 | virtual ~CFilmGoal(); 21 | 22 | bool Activate(); 23 | bool Deactivate( bool force = false, bool affect_tree = true ); 24 | bool Update(); 25 | 26 | void CheckpointHit(); 27 | void StartFilming(); 28 | protected: 29 | bool target_object_visible(); 30 | 31 | bool m_filming; 32 | 33 | Tmr::Time m_timeOnCamera; 34 | Tmr::Time m_timeRequired; 35 | Tmr::Time m_totalTime; 36 | 37 | int m_numShotsRequired; 38 | int m_numShotsAchieved; 39 | 40 | }; 41 | 42 | } 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/FindGapsGoal.h: -------------------------------------------------------------------------------- 1 | // find x gaps 2 | 3 | #ifndef __SK_MODULES_SKATE_FINDGAPSGOAL_H__ 4 | #define __SK_MODULES_SKATE_FINDGAPSGOAL_H__ 5 | 6 | #ifndef __CORE_DEFINES_H 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | namespace Game 13 | { 14 | 15 | class CFindGapsGoal : public CGoal 16 | { 17 | 18 | public: 19 | CFindGapsGoal( Script::CStruct* pParams ); 20 | virtual ~CFindGapsGoal(); 21 | 22 | bool Activate(); 23 | bool Deactivate( bool force = false, bool affect_tree = true ); 24 | 25 | void CheckGaps(); 26 | protected: 27 | int m_numGapsToFind; 28 | }; 29 | 30 | } // namespace game 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/HorseGoal.h: -------------------------------------------------------------------------------- 1 | // horse goal subclass 2 | #ifndef __SK_MODULES_SKATE_HORSEGOAL_H__ 3 | #define __SK_MODULES_SKATE_HORSEGOAL_H__ 4 | 5 | #ifndef __CORE_DEFINES_H 6 | #include 7 | #endif 8 | 9 | #include 10 | 11 | namespace Game 12 | { 13 | 14 | 15 | class CHorseGoal : public CGoal 16 | { 17 | 18 | public: 19 | CHorseGoal( Script::CStruct* pParams ); 20 | virtual ~CHorseGoal(); 21 | 22 | void CheckScore(); 23 | bool ShouldExpire(); 24 | bool IsExpired(); 25 | void Expire(); 26 | }; 27 | 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/Minigame.h: -------------------------------------------------------------------------------- 1 | #ifndef __SK_MODULES_SKATE_MINIGAME_H__ 2 | #define __SK_MODULES_SKATE_MINIGAME_H__ 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | #include 9 | 10 | namespace Game 11 | { 12 | 13 | 14 | class CMinigame : public CGoal 15 | { 16 | 17 | public: 18 | CMinigame( Script::CStruct* pParams ); 19 | virtual ~CMinigame(); 20 | 21 | bool Activate(); 22 | 23 | void LoadSaveData( Script::CStruct* pFlags ); 24 | void GetSaveData( Script::CStruct* pFlags ); 25 | 26 | bool ShouldUseTimer(); 27 | bool AddTime( int amount ); 28 | bool CountAsActive() { return false; } 29 | bool IsExpired(); 30 | bool CheckRecord( int value ); 31 | int GetRecord(); 32 | bool CanRetry(); 33 | void SetStartTime(); 34 | void UpdateTimer(); 35 | 36 | bool Update(); 37 | void UpdateMinigameTimer(); 38 | 39 | bool AwardCash( int amount ); 40 | 41 | protected: 42 | int m_record; 43 | int m_cashLimit; 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/NetGoal.h: -------------------------------------------------------------------------------- 1 | #ifndef __SK_MODULES_SKATE_NETGOAL_H__ 2 | #define __SK_MODULES_SKATE_NETGOAL_H__ 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | #include 9 | 10 | namespace Game 11 | { 12 | 13 | 14 | class CNetGoal : public CGoal 15 | { 16 | 17 | public: 18 | CNetGoal( Script::CStruct* pParams ); 19 | virtual ~CNetGoal(); 20 | 21 | bool Update(); 22 | bool Deactivate( bool force = false, bool affect_tree = true ); 23 | bool Activate(); 24 | bool IsExpired(); 25 | void Expire(); 26 | 27 | protected: 28 | bool m_initialized; 29 | }; 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/RaceGoal.h: -------------------------------------------------------------------------------- 1 | #ifndef __SK_MODULES_SKATE_RACEGOAL_H__ 2 | #define __SK_MODULES_SKATE_RACEGOAL_H__ 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | #include 9 | 10 | namespace Game 11 | { 12 | 13 | class CRaceGoal : public CGoal 14 | { 15 | friend class CGoalManager; 16 | 17 | public: 18 | CRaceGoal( Script::CStruct* pParams ); 19 | virtual ~CRaceGoal(); 20 | 21 | bool ShouldExpire(); 22 | bool IsExpired(); 23 | void Expire(); 24 | bool NextRaceWaypoint( uint32 goalId ); 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Code/Sk/Modules/Skate/SkatetrisGoal.h: -------------------------------------------------------------------------------- 1 | // skatetris subclass 2 | 3 | #ifndef __SK_MODULES_SKATE_SKATETRISGOAL_H__ 4 | #define __SK_MODULES_SKATE_SKATETRISGOAL_H__ 5 | 6 | #ifndef __CORE_DEFINES_H 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | namespace Game 13 | { 14 | 15 | const int vMAXTETRISTRICKS = 30; 16 | 17 | struct tetrisTrick 18 | { 19 | uint32 trickNameChecksum; 20 | uint32 altTrickNameChecksum; 21 | uint32 keyCombo; 22 | uint32 screenElementId; 23 | bool invalid; 24 | bool require_perfect; 25 | int group_id; 26 | int spin_mult; 27 | int num_taps; 28 | }; 29 | 30 | class CSkatetrisGoal : public CGoal 31 | { 32 | 33 | public: 34 | CSkatetrisGoal( Script::CStruct* pParams ); 35 | virtual ~CSkatetrisGoal(); 36 | 37 | bool Activate(); 38 | bool Deactivate( bool force = false, bool affect_tree = true ); 39 | bool Win(); 40 | void Expire(); 41 | 42 | bool Update(); 43 | 44 | void StartTetrisGoal(); 45 | void EndTetrisGoal(); 46 | void CheckTetrisTricks(); 47 | void CheckTetrisCombos(); 48 | void AddTetrisTrick( int num_to_add = 1 ); 49 | void UpdateFadedTricks(); 50 | 51 | void RemoveTrick( int index ); 52 | 53 | bool AllTricksCleared(); 54 | 55 | void ClearAllTricks(); 56 | 57 | bool IsSingleComboSkatetris(); 58 | bool IsComboSkatetris(); 59 | bool IsTricktris(); 60 | protected: 61 | 62 | tetrisTrick m_tetrisTricks[vMAXTETRISTRICKS]; 63 | int m_numTetrisTricks; 64 | int m_tetrisTime; 65 | bool m_validGroups[vMAXTETRISTRICKS]; 66 | }; 67 | 68 | } 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /Code/Sk/Ngps/crt0.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sk/Ngps/crt0.s -------------------------------------------------------------------------------- /Code/Sk/Objects/GameObj.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Sk/Objects 3 | //* FILENAME: gameobj.h 4 | //* OWNER: Gary Jesdanun 5 | //* CREATION DATE: 11/02/2000 6 | //**************************************************************************** 7 | 8 | #ifndef __OBJECTS_GAMEOBJ_H 9 | #define __OBJECTS_GAMEOBJ_H 10 | 11 | /***************************************************************************** 12 | ** Includes ** 13 | *****************************************************************************/ 14 | 15 | #include 16 | #include 17 | 18 | namespace Script 19 | { 20 | class CStruct; 21 | } 22 | 23 | /***************************************************************************** 24 | ** Defines ** 25 | *****************************************************************************/ 26 | 27 | namespace Obj 28 | { 29 | class CCompositeObject; 30 | class CGeneralManager; 31 | 32 | /***************************************************************************** 33 | ** Public Prototypes ** 34 | *****************************************************************************/ 35 | 36 | void CreateParticleEmitter( CGeneralManager* p_obj_man, Script::CStruct* pNodeData ); 37 | CCompositeObject* CreateGameObj( CGeneralManager* p_obj_man, Script::CStruct* pNodeData ); 38 | void CreateLevelObj( CGeneralManager* p_obj_man, Script::CStruct* pNodeData ); 39 | void CreateParticleObject( CGeneralManager* p_obj_man, Script::CStruct* pNodeData ); 40 | 41 | } // namespace Obj 42 | 43 | #endif // __OBJECTS_GAMEOBJ_H 44 | -------------------------------------------------------------------------------- /Code/Sk/Objects/ped.h: -------------------------------------------------------------------------------- 1 | //**************************************************************************** 2 | //* MODULE: Sk/Objects 3 | //* FILENAME: ped.h 4 | //* OWNER: Gary Jesdanun 5 | //* CREATION DATE: 10/15/2000 6 | //**************************************************************************** 7 | 8 | #ifndef __OBJECTS_PED_H 9 | #define __OBJECTS_PED_H 10 | 11 | /***************************************************************************** 12 | ** Includes ** 13 | *****************************************************************************/ 14 | 15 | #include 16 | #include 17 | 18 | /***************************************************************************** 19 | ** Defines ** 20 | *****************************************************************************/ 21 | 22 | namespace Script 23 | { 24 | class CStruct; 25 | } 26 | 27 | namespace Obj 28 | { 29 | 30 | class CGeneralManager; 31 | 32 | /***************************************************************************** 33 | ** Public Prototypes ** 34 | *****************************************************************************/ 35 | 36 | void CreatePed(CGeneralManager* p_obj_man, Script::CStruct* pNodeData); 37 | 38 | /***************************************************************************** 39 | ** Inline Functions ** 40 | *****************************************************************************/ 41 | 42 | } // namespace Obj 43 | 44 | #endif // __OBJECTS_PED_H 45 | -------------------------------------------------------------------------------- /Code/Sk/Scripting/cfuncs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sk/Scripting/cfuncs.cpp -------------------------------------------------------------------------------- /Code/Sk/Scripting/gs_file.h: -------------------------------------------------------------------------------- 1 | #ifndef __SK_SCRIPTING_GS_FILE_H 2 | #define __SK_SCRIPTING_GS_FILE_H 3 | 4 | #ifndef __SCRIPTING_SCRIPTDEFS_H 5 | #include // For enums 6 | #endif 7 | 8 | namespace SkateScript 9 | { 10 | using namespace Script; 11 | 12 | void LoadAllStartupQBFiles(); 13 | void LoadQB(const char *p_fileName, 14 | EBoolAssertIfDuplicateSymbols assertIfDuplicateSymbols=NO_ASSERT_IF_DUPLICATE_SYMBOLS); 15 | void UnloadQB(uint32 fileNameChecksum); 16 | uint32 GenerateFileNameChecksum(const char *p_fileName); 17 | void UnloadQB(const char *p_fileName); 18 | 19 | } // namespace SkateScript 20 | 21 | #endif // #ifndef __SK_SCRIPTING_GS_FILE_H 22 | 23 | -------------------------------------------------------------------------------- /Code/Sk/Scripting/gs_init.h: -------------------------------------------------------------------------------- 1 | #ifndef __SK_SCRIPTING_GS_INIT_H 2 | #define __SK_SCRIPTING_GS_INIT_H 3 | 4 | namespace SkateScript 5 | { 6 | 7 | void Init(); 8 | void Preload(); 9 | 10 | } // namespace SkateScript 11 | 12 | #endif // #ifndef __SK_SCRIPTING_GS_INIT_H 13 | -------------------------------------------------------------------------------- /Code/Sk/Scripting/mcfuncs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sk/Scripting/mcfuncs.cpp -------------------------------------------------------------------------------- /Code/Sk/language.h: -------------------------------------------------------------------------------- 1 | #ifndef __SK_LANGUAGE_H 2 | #define __SK_LANGUAGE_H 3 | 4 | #ifdef __PLAT_XBOX__ 5 | #include 6 | #endif // __PLAT_XBOX__ 7 | 8 | // These only apply if PAL 9 | #define ENGLISH 1 10 | #define FRENCH 0 11 | #define GERMAN 0 12 | 13 | inline bool IsEnglish( void ) 14 | { 15 | # ifdef __PLAT_XBOX__ 16 | DWORD lang = XGetLanguage(); 17 | if( lang == XC_LANGUAGE_ENGLISH ) 18 | return true; 19 | else 20 | { 21 | // For NTSC, the only language allowed is English. 22 | if( XGetVideoStandard() != XC_VIDEO_STANDARD_PAL_I ) 23 | { 24 | return true; 25 | } 26 | 27 | // Any languages other than French and German should also be considered English. 28 | if(( lang != XC_LANGUAGE_GERMAN ) && ( lang != XC_LANGUAGE_FRENCH )) 29 | { 30 | return true; 31 | } 32 | } 33 | return false; 34 | // return true; // For now... 35 | # else 36 | # if ENGLISH 37 | return true; 38 | # else 39 | return false 40 | # endif // ENGLISH 41 | # endif // __PLAT_XBOX__ 42 | } 43 | 44 | 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /Code/Sk/product_codes.h: -------------------------------------------------------------------------------- 1 | #ifndef __SK_PRODUCT_CODES_H 2 | #define __SK_PRODUCT_CODES_H 3 | 4 | namespace Config 5 | { 6 | 7 | // The mem card headers 8 | // These are also used to derive the elf name for comparison so that the language can be 9 | // autodetected, in sys\config\ngps\p_config.cpp 10 | #define NGPS_NTSC "BASLUS-20731" // Mick: 20731 is the official THPS5 NTSC SLUS number 11 | #define NGPS_PAL_ENGLISH "BESLES-51848" 12 | #define NGPS_PAL_FRENCH "BESLES-51851" // <<<<<<<<<<<<<<<<<<< just guessing here..... 13 | #define NGPS_PAL_GERMAN "BESLES-51852" 14 | #define NGPS_PAL_ITALIAN "BESLES-51853" 15 | #define NGPS_PAL_SPANISH "BESLES-51854" 16 | 17 | }; 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /Code/Sys/Config/Win32/p_config.cpp: -------------------------------------------------------------------------------- 1 | // Config Manager stuff. KSH 20 Mar 2002 2 | #include 3 | 4 | namespace Config 5 | { 6 | 7 | void Plat_Init(sint argc, char** argv) 8 | { 9 | gHardware = HARDWARE_WIN32; 10 | gLanguage = LANGUAGE_ENGLISH; 11 | gGotExtraMemory = true; 12 | } 13 | 14 | } // namespace Config 15 | 16 | -------------------------------------------------------------------------------- /Code/Sys/Config/XBox/p_config.cpp: -------------------------------------------------------------------------------- 1 | // Config Manager stuff. KSH 20 Mar 2002 2 | #include 3 | 4 | namespace Config 5 | { 6 | 7 | void Plat_Init(sint argc, char** argv) 8 | { 9 | gHardware = HARDWARE_XBOX; 10 | DWORD lang = XGetLanguage(); 11 | if( lang == XC_LANGUAGE_ENGLISH ) 12 | gLanguage = LANGUAGE_ENGLISH; 13 | else 14 | { 15 | if( XGetVideoStandard() != XC_VIDEO_STANDARD_PAL_I ) 16 | { 17 | // For NTSC, the only language allowed is English. 18 | gLanguage = LANGUAGE_ENGLISH; 19 | } 20 | else if( lang == XC_LANGUAGE_FRENCH ) 21 | { 22 | gLanguage = LANGUAGE_FRENCH; 23 | } 24 | else if( lang == XC_LANGUAGE_GERMAN ) 25 | { 26 | gLanguage = LANGUAGE_GERMAN; 27 | } 28 | else 29 | { 30 | // Any languages other than French and German should also be considered English. 31 | gLanguage = LANGUAGE_ENGLISH; 32 | } 33 | } 34 | 35 | // Kind of meaningless, but default CD to true for Final builds, false otherwise. 36 | # ifdef __NOPT_ASSERT__ 37 | gCD = false; 38 | # else 39 | gCD = true; 40 | # endif 41 | 42 | switch( XGetVideoStandard()) 43 | { 44 | case XC_VIDEO_STANDARD_PAL_I: 45 | { 46 | gDisplayType = DISPLAY_TYPE_PAL; 47 | gFPS = 50; 48 | if( XGetVideoFlags() & XC_VIDEO_FLAGS_PAL_60Hz ) 49 | { 50 | gFPS = 60; 51 | } 52 | break; 53 | } 54 | case XC_VIDEO_STANDARD_NTSC_M: 55 | case XC_VIDEO_STANDARD_NTSC_J: 56 | { 57 | gDisplayType = DISPLAY_TYPE_NTSC; 58 | gFPS = 60; 59 | break; 60 | } 61 | default: 62 | { 63 | Dbg_MsgAssert( 0, ("Unrecognized return value (%d) from XGetVideoStandard()", XGetVideoStandard())); 64 | break; 65 | } 66 | } 67 | } 68 | 69 | } // namespace Config 70 | 71 | -------------------------------------------------------------------------------- /Code/Sys/File/XBox/hed.h: -------------------------------------------------------------------------------- 1 | /* Header file functionality... 2 | .Hed files that describe the contents of .Wad files 3 | Written by Ken, stolen by Matt*/ 4 | #ifndef __HED_H__ 5 | #define __HED_H__ 6 | 7 | namespace File 8 | { 9 | 10 | struct SHed 11 | { 12 | // A SECTOR_SIZE aligned offset of a file within skate3.wad 13 | uint32 Offset; 14 | 15 | // The file size, which is the raw file size, not rounded up 16 | // to a multiple of SECTOR_SIZE 17 | uint32 FileSize; 18 | 19 | // The filename, which is actually bigger than one byte, tee hee. 20 | const char pFilename[1]; 21 | }; 22 | 23 | 24 | SHed *FindFileInHed(const char *pFilename, SHed *pHed ); 25 | SHed *FindFileInHedUsingChecksum( uint32 checksum, SHed *pHed, bool stripPath ); 26 | SHed *LoadHed( const char *filename ); 27 | 28 | } // namespace File 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Code/Sys/File/memfile.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // memfile.h 4 | // 5 | // memory mapped file replacement functions 6 | // allow you to load a file to memory, and then use these MemFile:: functions 7 | // instead of File:: functions, to load it exactly the same as before 8 | // so you would replace 9 | // File::Read( 10 | // with 11 | // MEM_Read( 12 | // 13 | // Note that since these are macros, they dont return anything 14 | // 15 | #define MEM_Read( addr, size, count, pFP ) \ 16 | { \ 17 | char *p = (char*)(addr); \ 18 | char *q = (char*)(pFP); \ 19 | int total = (size)*(count); \ 20 | for (;total>0;total--) \ 21 | *p++ = *q++; \ 22 | pFP = (void*) q; \ 23 | } \ 24 | 25 | #define MEM_Seek(pFP, offset, origin ) \ 26 | { \ 27 | pFP = (void*)((char*)(pFP) + (offset)); \ 28 | } \ 29 | 30 | -------------------------------------------------------------------------------- /Code/Sys/File/ngc/hed.h: -------------------------------------------------------------------------------- 1 | /* Header file functionality... 2 | .Hed files that describe the contents of .Wad files 3 | Written by Ken, stolen by Matt*/ 4 | #ifndef __HED_H__ 5 | #define __HED_H__ 6 | 7 | namespace File 8 | { 9 | 10 | struct SHedFile 11 | { 12 | // A SECTOR_SIZE aligned offset of a file within skate3.wad 13 | uint32 Offset; 14 | 15 | // The file size, which is the raw file size, not rounded up 16 | // to a multiple of SECTOR_SIZE 17 | uint32 FileSize; 18 | 19 | // Filename checksum (does not include directory). 20 | uint32 Checksum; 21 | }; 22 | 23 | struct SHed 24 | { 25 | // Number of files in this directory. 26 | uint32 numFiles; 27 | 28 | // Checksum of this directory. 29 | uint32 Checksum; 30 | 31 | // Pointer to File list. 32 | SHedFile * p_fileList; 33 | 34 | // The filename, which is actually bigger than one byte, tee hee. 35 | // const char pFilename[1]; 36 | }; 37 | 38 | 39 | SHedFile *FindFileInHed(const char *pFilename, SHed *pHed ); 40 | SHedFile *FindFileInHedUsingChecksum( uint32 checksum, SHed *pHed ); 41 | SHed *LoadHed( const char *filename ); 42 | 43 | } // namespace File 44 | 45 | #endif 46 | 47 | 48 | -------------------------------------------------------------------------------- /Code/Sys/File/ngps/FileIO/Makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(wildcard PathDefs),) 2 | PathDefs: 3 | iop-path-setup 4 | make all 5 | else 6 | include PathDefs 7 | endif 8 | 9 | TOPDIR = /usr/local/sce 10 | INCOPT = -I$(TOPDIR)/common/include -I$(TOPDIR)/iop/install/include 11 | 12 | CFLAGS = $(INCOPT) -I. -Wall -G0 -g -D__LANGUAGE_C 13 | ASFLAGS = $(INCOPT) -G0 14 | RM = /bin/rm -f 15 | 16 | COMPILE.s = $(CC) -xassembler-with-cpp $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c 17 | 18 | #----------- customize section -------------- 19 | PROGNAME = fileio 20 | 21 | OBJS = start.o command.o 22 | #ILIBS = -ilb=$(TOP)lib/iop.ilb 23 | ILIBS = 24 | LIBI = /usr/local/sce/iop/install/lib 25 | 26 | #----------- rules -------------- 27 | all: $(PROGNAME).irx 28 | 29 | clean: 30 | rm -f *.o $(PROGNAME).irx *.obj *.map 31 | 32 | $(PROGNAME).irx: $(OBJS) 33 | $(LINK.o) -o $@ \ 34 | $(OBJS) -L../../../lib -L./ -L$(LIBI) -ilb=cdvdman.ilb 35 | 36 | start.o: fileio.h fileio_iop.h 37 | command.o: fileio.h fileio_iop.h 38 | -------------------------------------------------------------------------------- /Code/Sys/File/ngps/FileIO/PathDefs: -------------------------------------------------------------------------------- 1 | AR = snarl.exe 2 | AS = ps2cc -iop 3 | CC = ps2cc -iop 4 | GCC = ps2cc -iop 5 | LD = ps2cc -iop 6 | NM = C:/usr/local/sce/iop/gcc/bin/iop-nm.exe 7 | SIZE = iop-size.exe 8 | STRIP = C:/usr/local/sce/iop/gcc/bin/iop-strip.exe 9 | RANLIB = C:/usr/local/sce/iop/gcc/bin/iop-ranlib.exe 10 | OBJCOPY = C:/usr/local/sce/iop/gcc/bin/iop-objcopy.exe 11 | OBJDUMP = C:/usr/local/sce/iop/gcc/bin/iop-objdump.exe 12 | IFIXUP = iopfixup.exe 13 | ILBGEN = C:/usr/local/sce/iop/gcc/bin/ioplibgen.exe 14 | ILBLD = C:/usr/local/sce/iop/gcc/mipsel-scei-elfl/bin/ioplibld.exe 15 | ILBDUMP = C:/usr/local/sce/iop/gcc/mipsel-scei-elfl/bin/ioplibdump.exe 16 | BIN2OBJ = bin2elf.exe 17 | -------------------------------------------------------------------------------- /Code/Sys/File/ngps/FileIO/start.c: -------------------------------------------------------------------------------- 1 | /* FileIO -- Converted from Sony samples -- Garrett Oct 2002 */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "fileio.h" 10 | #include "fileio_iop.h" 11 | 12 | ModuleInfo Module = {"fileio_driver", 0x0112}; 13 | 14 | // in command.c 15 | extern int fileio_command_loop (void); 16 | 17 | int start() 18 | { 19 | struct ThreadParam param; 20 | int th; 21 | 22 | if (!sceSifCheckInit()) 23 | { 24 | sceSifInit(); 25 | } 26 | sceSifInitRpc(0); 27 | 28 | printf("FileIO driver version 0.1\n"); 29 | 30 | param.attr = TH_C; 31 | param.entry = fileio_command_loop; 32 | param.initPriority = BASE_priority - 2; 33 | param.stackSize = 0x800; 34 | param.option = 0; 35 | th = CreateThread(¶m); 36 | if (th > 0) { 37 | StartThread(th, 0); 38 | } else { 39 | return 1; 40 | } 41 | 42 | return 0; 43 | } 44 | 45 | /* ---------------------------------------------------------------- 46 | * End on File 47 | * ---------------------------------------------------------------- */ 48 | -------------------------------------------------------------------------------- /Code/Sys/File/ngps/hed.h: -------------------------------------------------------------------------------- 1 | /* Header file functionality... 2 | .Hed files that describe the contents of .Wad files 3 | Written by Ken, stolen by Matt*/ 4 | #ifndef __HED_H__ 5 | #define __HED_H__ 6 | 7 | namespace File 8 | { 9 | 10 | struct SHedFile 11 | { 12 | // Constants 13 | enum 14 | { 15 | mNO_WAD = 0x80000000 16 | }; 17 | 18 | bool HasNoWad() const { return FileSize & mNO_WAD; } 19 | uint32 GetFileSize() const { return FileSize & (~mNO_WAD); } 20 | 21 | union 22 | { 23 | uint32 Offset; // A SECTOR_SIZE aligned offset of a file within skate3.wad 24 | char * p_filename; // The filename itself (for no_wad heds) 25 | }; 26 | 27 | // The file size, which is the raw file size, not rounded up 28 | // to a multiple of SECTOR_SIZE. Highest bit is set if no wad 29 | // file is associated with it. 30 | uint32 FileSize; 31 | 32 | // Filename checksum (does not include directory). 33 | uint32 Checksum; 34 | }; 35 | 36 | struct SHed 37 | { 38 | // Number of files in this directory. 39 | uint32 numFiles; 40 | 41 | // Checksum of this directory. 42 | uint32 Checksum; 43 | 44 | // Pointer to File list. 45 | SHedFile * p_fileList; 46 | 47 | // The filename, which is actually bigger than one byte, tee hee. 48 | // const char pFilename[1]; 49 | }; 50 | 51 | 52 | SHedFile *FindFileInHed(const char *pFilename, SHed *pHed ); 53 | SHedFile *FindFileInHedUsingChecksum( uint32 checksum, SHed *pHed ); 54 | SHed *LoadHed( const char *filename, bool force_cd = false, bool no_wad = false ); 55 | 56 | } // namespace File 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /Code/Sys/File/pip.h: -------------------------------------------------------------------------------- 1 | #ifndef __FILE_PIP_H 2 | #define __FILE_PIP_H 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | namespace Script 9 | { 10 | class CStruct; 11 | class CScript; 12 | } 13 | 14 | namespace Pip 15 | { 16 | void LoadPre(const char *p_preFileName); 17 | bool UnloadPre(const char *p_preFileName); 18 | 19 | void* Load(const char *p_fileName); 20 | void Unload(const char *p_fileName); 21 | uint32 GetFileSize(const char *p_fileName); 22 | 23 | // GJ: sometimes it's useful to do this 24 | // by checksum, so that we don't have to keep 25 | // the full filename string hanging around 26 | void Unload(uint32 fileNameCRC); 27 | uint32 GetFileSize(uint32 fileNameCRC); 28 | 29 | const char *GetNextLoadedPre(const char *p_pre_name=NULL); 30 | bool PreFileIsInUse(const char *p_pre_name); 31 | 32 | bool ScriptLoadPipPre(Script::CStruct *pParams, Script::CScript *pScript); 33 | bool ScriptUnloadPipPre(Script::CStruct *pParams, Script::CScript *pScript); 34 | bool ScriptDumpPipPreStatus(Script::CStruct *pParams, Script::CScript *pScript); 35 | 36 | 37 | } 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /Code/Sys/Mem/PoolManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYS_MEM_POOLMANAGER_H 2 | #define __SYS_MEM_POOLMANAGER_H 3 | 4 | #include 5 | 6 | namespace Mem 7 | { 8 | 9 | 10 | /* 11 | Used in cases where one can't simply make a class poolable 12 | by inheriting from CPoolable, for example, where we want 13 | every HashItem class instance to come off the same 14 | pool. 15 | */ 16 | 17 | class PoolManager 18 | { 19 | public: 20 | 21 | enum 22 | { 23 | vHASH_ITEM_POOL = 0, 24 | vTOTAL_POOLS = 1, 25 | }; 26 | 27 | static void SSetupPool(int poolId, int numItems); 28 | static void SDestroyPool(int poolId); 29 | 30 | static void * SCreateItem(int poolId); 31 | static void SFreeItem(int poolId, void *pItem); 32 | static Mem::CCompactPool * SGetPool(int poolId); 33 | 34 | 35 | private: 36 | 37 | static int s_get_item_size(int poolId); 38 | 39 | static Mem::CCompactPool *sp_pool[vTOTAL_POOLS]; 40 | }; 41 | 42 | } 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /Code/Sys/Mem/Poolable.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Mem 5 | { 6 | 7 | int gHeapPools = false; // set to true to use debug heap instead of pools 8 | 9 | 10 | CCompactPool *CPoolable::sp_pool[POOL_STACK_SIZE] = {NULL,NULL}; 11 | bool CPoolable::s_internallyCreatedPool[POOL_STACK_SIZE] = {false,false}; 12 | int CPoolable::s_currentPool=0; 13 | 14 | 15 | PoolTest::PoolTest() 16 | { 17 | printf("created PoolTest object\n"); 18 | } 19 | 20 | 21 | 22 | 23 | PoolTest::~PoolTest() 24 | { 25 | printf("~PoolTest()\n"); 26 | } 27 | 28 | 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Code/Sys/MemCard/XBox/p_McMan.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sys/MemCard/XBox/p_McMan.cpp -------------------------------------------------------------------------------- /Code/Sys/ngc/p_aram.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARAM_H_ 2 | #define _ARAM_H_ 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | #include 9 | 10 | namespace NsARAM 11 | { 12 | typedef enum { 13 | BOTTOMUP = 0, 14 | TOPDOWN, 15 | SKATER0, 16 | SKATER1, 17 | SCRIPT, 18 | 19 | NUMHEAPS, 20 | } HEAPTYPE; 21 | 22 | void init ( void ); 23 | uint32 alloc ( uint32 size, HEAPTYPE heap = BOTTOMUP ); 24 | void free ( uint32 p ); 25 | uint32 getSize ( uint32 p ); 26 | 27 | uint32 unused ( void ); 28 | }; 29 | 30 | #endif // _ARAM_H_ 31 | 32 | 33 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_assert.h: -------------------------------------------------------------------------------- 1 | #define assertf( _exp, _params ) ( ( _exp ) ? ( void ) 0 : ( OSReport ( "" ), OSReport ( "**************************************\n" ), OSReport ( "Assertion failed: \"%s\"\n", #_exp ), OSReport _params, OSPanic(__FILE__, __LINE__, "Function \"%s\" failed", __FUNCTION__ ) ) ) 2 | #define assert( _exp ) ( ( _exp ) ? ( void ) 0 : ( OSReport ( "" ), OSReport ( "**************************************\n" ), OSReport ( "Assertion failed: \"%s\"\n", #_exp ), OSPanic(__FILE__, __LINE__, "Function \"%s\" failed", __FUNCTION__ ) ) ) 3 | #define assertp( _ptr ) ( ( _ptr ) ? ( void ) 0 : ( OSReport ( "" ), OSReport ( "**************************************\n" ), OSReport ( "Pointer Assertion failed: \"%s\" = %08x\n", #_ptr, _ptr ), OSPanic(__FILE__, __LINE__, "Function \"%s\" failed", __FUNCTION__ ) ) ) 4 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_bbox.h: -------------------------------------------------------------------------------- 1 | #ifndef _BBOX_H_ 2 | #define _BBOX_H_ 3 | 4 | #include 5 | #include "p_matrix.h" 6 | 7 | class NsBBox 8 | { 9 | public: 10 | NsVector m_min; 11 | NsVector m_max; 12 | }; 13 | 14 | #endif // _BBOX_H_ 15 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef _BUFFER_H_ 2 | #define _BUFFER_H_ 3 | 4 | #ifndef __CORE_DEFINES_H 5 | #include 6 | #endif 7 | 8 | namespace NsBuffer 9 | { 10 | void init ( int size ); 11 | void reset ( bool clear = false ); 12 | void begin ( void ); 13 | void end ( void ); 14 | 15 | void * alloc ( int size ); 16 | 17 | // Stat tracking 18 | int bytes_used ( void ); 19 | 20 | int get_size ( void ); 21 | } 22 | 23 | #endif // _ARAM_H_ 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_collision.h: -------------------------------------------------------------------------------- 1 | //#ifndef _COLLISION_H_ 2 | //#define _COLLISION_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_triangle.h" 6 | //#include "p_matrix.h" 7 | //#include "p_dl.h" 8 | // 9 | //typedef struct { 10 | // unsigned short type; 11 | // unsigned char leftType; 12 | // unsigned char rightType; 13 | // unsigned short leftNode; 14 | // unsigned short rightNode; 15 | // float leftValue; 16 | // float rightValue; 17 | //} NsBranch; 18 | // 19 | //typedef struct { 20 | // unsigned short numPolygons; 21 | // unsigned short firstPolygon; 22 | //} NsLeaf; 23 | // 24 | //class NsTree 25 | //{ 26 | // int testPolygons ( unsigned int numPolygons, unsigned int polyOffset, NsLine * pLine, NsDL::Collision_LineCallback pCb, void * pData ); 27 | //public: 28 | // unsigned int m_numBranchNodes; 29 | // unsigned int m_numLeafNodes; 30 | // unsigned int m_numTriangles; 31 | // NsBranch * m_pBranchNodes; 32 | // NsLeaf * m_pLeafNodes; 33 | // unsigned int * m_pTriangleMap; 34 | // 35 | // NsDL * m_pDL; 36 | // 37 | // NsTree * m_pNext; 38 | // 39 | // NsTree ( void * pTree, unsigned int numLeaf, unsigned int numTri, NsDL * pDL ); 40 | // ~NsTree (); 41 | // 42 | // int findCollision ( NsLine * pLine, NsDL::Collision_LineCallback pCb, void * pData ); 43 | //}; 44 | // 45 | //class NsCollision 46 | //{ 47 | // NsTree * m_pHead; 48 | //public: 49 | // 50 | // NsCollision (); 51 | // ~NsCollision (); 52 | // 53 | // void addTree ( void * pTree, unsigned int numLeaf, unsigned int numTri, NsDL * pDL ); 54 | // 55 | // int findCollision ( NsLine * pLine, NsDL::Collision_LineCallback pCb, void * pData ); 56 | //}; 57 | // 58 | //#endif // _COLLISION_H_ 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_debugfont.h: -------------------------------------------------------------------------------- 1 | //#ifndef _DEBUGFONT_H_ 2 | //#define _DEBUGFONT_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_prim.h" 6 | // 7 | //typedef enum { 8 | // NsFontEffect_None = 0, 9 | // NsFontEffect_Shadow, 10 | // NsFontEffect_Outline, 11 | // NsFontEffect_Bold, 12 | // 13 | // NsFontEffect_Max 14 | //} NsFontEffect; 15 | // 16 | //namespace NsDebugFont 17 | //{ 18 | // void printCharacterScaleUp ( float x, float y, int size, GXColor color, char c ); 19 | // void printCharacterScaleDown ( float x, float y, int size, GXColor color, char c ); 20 | // void printCharacter ( float x, float y, int size, GXColor color, char c ); 21 | // void printf ( float x, float y, NsFontEffect fe, int size, GXColor color, char * format, ... ); 22 | // 23 | // void setYSpacing ( float spacing ); 24 | //}; 25 | // 26 | //#endif // _DEBUGFONT_H_ 27 | 28 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_dlman.h: -------------------------------------------------------------------------------- 1 | //#ifndef _DLMAN_H_ 2 | //#define _DLMAN_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_dl.h" 6 | // 7 | //class NsDLMan 8 | //{ 9 | // void * m_pDLBufferStart; 10 | // void * m_pDLBufferCurrent; 11 | // void * m_pDLBufferEnd; 12 | // unsigned int m_bufferSize; 13 | //public: 14 | // NsDLMan (); 15 | // NsDLMan ( int size ); 16 | // 17 | // NsDL * open ( void ); 18 | // void close ( NsDL * pDL ); 19 | // void close ( unsigned int size ); 20 | // unsigned int freeSpace ( void ); 21 | // 22 | // void reset ( void ) { m_pDLBufferCurrent = m_pDLBufferStart; }; 23 | //}; 24 | // 25 | //#endif // _DLMAN_H_ 26 | 27 | 28 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_dma.h: -------------------------------------------------------------------------------- 1 | #ifndef _DMA_H_ 2 | #define _DMA_H_ 3 | 4 | #include 5 | 6 | namespace NsDMA 7 | { 8 | void toARAM ( u32 aram, void * p_mram, int size ); 9 | void toMRAM ( void * p_mram, u32 aram, int size ); 10 | }; 11 | 12 | #endif // _DMA_H_ 13 | 14 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_dvd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sys/ngc/p_dvd.cpp -------------------------------------------------------------------------------- /Code/Sys/ngc/p_frame.h: -------------------------------------------------------------------------------- 1 | #ifndef _FRAME_H_ 2 | #define _FRAME_H_ 3 | 4 | #include 5 | #include "p_matrix.h" 6 | #include "p_vector.h" 7 | 8 | class NsFrame 9 | { 10 | NsMatrix m_model; 11 | public: 12 | NsFrame (); 13 | 14 | void setModelMatrix ( NsMatrix * m ) { m_model.copy( *m ); }; 15 | NsMatrix * getModelMatrix ( void ) { return &m_model; }; 16 | 17 | void translate ( NsVector * v, NsMatrix_Combine c ) { m_model.translate( v, c ); } 18 | void rotate ( NsVector * axis, float angle, NsMatrix_Combine c ) { m_model.rotate( axis, angle, c ); } 19 | void scale ( NsVector * v, NsMatrix_Combine c ) { m_model.scale( v, c ); } 20 | void identity ( void ) { m_model.identity(); } 21 | }; 22 | 23 | #endif // _FRAME_H_ 24 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_hashid.h: -------------------------------------------------------------------------------- 1 | //#ifndef _HASHID_H_ 2 | //#define _HASHID_H_ 3 | // 4 | //#include "p_hw.h" 5 | // 6 | //namespace NsHashID 7 | //{ 8 | // u32 encode ( const char * pString ); 9 | // u32 encode ( const unsigned char * pData, unsigned int length ); 10 | //}; 11 | // 12 | //#endif // _HASHID_H_ 13 | 14 | 15 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_hwinit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetailGameSourceCode/TonyHawksUnderground/d9287015c920e4011000dbacea67000859db762b/Code/Sys/ngc/p_hwinit.cpp -------------------------------------------------------------------------------- /Code/Sys/ngc/p_light.h: -------------------------------------------------------------------------------- 1 | //#ifndef _P_LIGHT_H_ 2 | //#define _P_LIGHT_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_frame.h" 6 | // 7 | //enum NsLightType 8 | //{ 9 | // NSLIGHT_UNKNOWM = 0, 10 | // NSLIGHT_DIRECTIONAL, 11 | // NSLIGHT_AMBIENT, 12 | //}; 13 | // 14 | //#define NSLIGHT_MAX_LIGHTS 4 15 | // 16 | //class NsLight 17 | //{ 18 | // static unsigned int m_SlotArray; 19 | // static GXLightObj m_LightObj[NSLIGHT_MAX_LIGHTS]; 20 | // static bool m_LightingHasChanged; 21 | // static GXColor m_AmbientColor; 22 | // 23 | // NsLightType m_Type; 24 | // NsFrame* m_pFrame; 25 | // GXColor m_Color; 26 | // NsFrame m_Frame; 27 | // bool m_On; 28 | // int m_Slot; 29 | // 30 | // public: 31 | // 32 | // static void loadup( void ); 33 | // static void loadupAmbient( void ); 34 | // static GXLightID getLightID( void ) { return (GXLightID)m_SlotArray; } 35 | // 36 | // NsLight( NsLightType type ); 37 | // ~NsLight(); 38 | // 39 | // void setFrame( NsFrame* p_frame ); 40 | // void setColor( GXColor color ); 41 | // void activate( bool on ); 42 | // void updateOrientation( void ); 43 | // void updateColor( void ); 44 | //}; 45 | // 46 | //#endif _P_LIGHT_H_ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_matman.h: -------------------------------------------------------------------------------- 1 | //#ifndef _MATMAN_H_ 2 | //#define _MATMAN_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_material.h" 6 | //#include "p_texman.h" 7 | //#include "p_collision.h" 8 | //#include "p_dl.h" 9 | //#include "p_triangle.h" 10 | // 11 | //class NsMaterialMan 12 | //{ 13 | // int m_refCount; 14 | //public: 15 | // NsMaterial * m_pMaterialList; 16 | // NsMaterial ** m_pSortedMaterialList; 17 | // int m_materialListSize; 18 | // int m_numTotal; 19 | // int m_numCulled; 20 | // 21 | // friend class NsModel; 22 | // 23 | // NsMaterialMan (); 24 | // NsMaterialMan ( unsigned int numEntries ); 25 | // ~NsMaterialMan (); 26 | // 27 | // NsMaterial * retrieve ( unsigned int number ); 28 | // 29 | // void draw ( void ); 30 | // 31 | // unsigned int cull ( NsMatrix * m ); 32 | // 33 | // void reset ( void ); 34 | // 35 | // void calculateBoundingBox ( NsCull_Item * pCull ); 36 | // 37 | // int findCollision ( NsLine * pLine, NsDL::Collision_LineCallback pCb, void * pData, void* pWorld ); 38 | // 39 | // void addReference ( void ) { m_refCount++; } 40 | // void removeReference ( void ) { m_refCount--; } 41 | // int totalReferences ( void ) { return m_refCount; } 42 | //}; 43 | // 44 | //#endif // _MATMAN_H_ 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_profile.h: -------------------------------------------------------------------------------- 1 | #ifndef _PROFILE_H_ 2 | #define _PROFILE_H_ 3 | 4 | #include 5 | #include "p_prim.h" 6 | 7 | class NsProfile 8 | { 9 | OSStopwatch m_watch; 10 | OSTime m_latch; 11 | OSTime m_accumulated; 12 | float * m_pHistoryBuffer; 13 | unsigned int m_historyBufferSize; 14 | unsigned int m_historyEntry; 15 | public: 16 | NsProfile (); 17 | NsProfile ( char * pName ); 18 | NsProfile ( char * pName, unsigned int historySize ); 19 | 20 | void start ( void ); 21 | void stop ( void ); 22 | void draw ( float x0, float y0, float x1, float y1, GXColor color ); 23 | void histogram ( float x0, float y0, float x1, float y1, GXColor color ); 24 | void append ( GXColor color, bool update ); 25 | }; 26 | 27 | #endif // _PROFILE_H_ 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_quat.h: -------------------------------------------------------------------------------- 1 | //#ifndef _QUAT_H_ 2 | //#define _QUAT_H_ 3 | // 4 | //#include "p_hw.h" 5 | // 6 | //class NsQuat 7 | //{ 8 | // Quaternion m_quat; 9 | //public: 10 | // friend class NsMatrix; 11 | // 12 | // NsQuat (); 13 | // 14 | // void slerp ( NsQuat& pQ0, NsQuat& pQ1, float time ); 15 | // 16 | // float getX ( void ) { return m_quat.x; }; 17 | // float getY ( void ) { return m_quat.y; }; 18 | // float getZ ( void ) { return m_quat.z; }; 19 | // float getW ( void ) { return m_quat.w; }; 20 | // 21 | // void setX ( float x ) { m_quat.x = x; }; 22 | // void setY ( float y ) { m_quat.y = y; }; 23 | // void setZ ( float z ) { m_quat.z = z; }; 24 | // void setW ( float w ) { m_quat.w = w; }; 25 | //}; 26 | // 27 | //#endif // _QUAT_H_ 28 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_screenshot.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------* 2 | Project: onetri 3 | File: screenshot.h 4 | 5 | Copyright 1998, 1999, 2000 Nintendo. All rights reserved. 6 | 7 | These coded instructions, statements, and computer programs contain 8 | proprietary information of Nintendo of America Inc. and/or Nintendo 9 | Company Ltd., and are protected by Federal copyright law. They may 10 | not be disclosed to third parties or copied or duplicated in any form, 11 | in whole or in part, without the prior written consent of Nintendo. 12 | 13 | Created 05-25-01 by Steve Rabin 14 | 15 | *---------------------------------------------------------------------------*/ 16 | 17 | 18 | #ifndef __SCREENSHOT_H__ 19 | #define __SCREENSHOT_H__ 20 | 21 | #include "dolphin.h" 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | // access to the memory allocator of choice 29 | typedef void*(*SCREENSHOTAllocator) ( u32 size ); 30 | typedef void (*SCREENSHOTDeallocator) ( void* block ); 31 | 32 | 33 | void SCREENSHOTService( void* bufferXFB, 34 | SCREENSHOTAllocator allocator, 35 | SCREENSHOTDeallocator deallocator ); 36 | 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | 43 | #endif // __SCREENSHOT_H__ 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_slerp.h: -------------------------------------------------------------------------------- 1 | //#ifndef _SLERP_H_ 2 | //#define _SLERP_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_matrix.h" 6 | // 7 | //class NsSlerp 8 | //{ 9 | // NsMatrix m_start; 10 | // NsMatrix m_end; 11 | // NsVector m_axis; 12 | // float m_angle; 13 | // int m_lerp; // 1=use lerp, 0=use slerp. 14 | //public: 15 | // NsSlerp (); 16 | // NsSlerp ( NsMatrix * start, NsMatrix * end ); 17 | // 18 | // void setMatrices ( NsMatrix * start, NsMatrix * end ); 19 | // void setMatrices ( MtxPtr start, MtxPtr end ); 20 | // 21 | // void getMatrix ( NsMatrix * result, float delta ); 22 | //}; 23 | // 24 | //#endif // _SLERP_H_ 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_tex.h: -------------------------------------------------------------------------------- 1 | //#ifndef _TEX_H_ 2 | //#define _TEX_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_quat.h" 6 | // 7 | //typedef enum { 8 | // NsTexture_Wrap_Clamp = GX_CLAMP, 9 | // NsTexture_Wrap_Repeat = GX_REPEAT, 10 | // NsTexture_Wrap_Mirror = GX_MIRROR 11 | //} NsTexture_Wrap; 12 | // 13 | //class NsTexture 14 | //{ 15 | //public: 16 | // unsigned int m_id; // 4 17 | // unsigned int m_version; // 4 18 | // unsigned short m_width; // 2 19 | // unsigned short m_height; // 2 20 | // unsigned int m_depth; // 4 21 | // unsigned int m_uploaded; // 4 22 | // GXTexMapID m_texID; // 4 23 | // unsigned int m_unused; // 4 24 | // void * m_pImage; // 4 25 | // void * m_pPalette; // 4 26 | // char m_name[60]; // 60 27 | // 28 | // NsTexture (); 29 | // ~NsTexture (); 30 | // 31 | // void upload ( NsTexture_Wrap wrap ); 32 | // void upload ( NsTexture_Wrap wrap, void * force_pImage, unsigned short force_width, unsigned short force_height ); 33 | //}; 34 | // 35 | //#endif // _TEX_H_ 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_texman.h: -------------------------------------------------------------------------------- 1 | //#ifndef _TEXMAN_H_ 2 | //#define _TEXMAN_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_tex.h" 6 | // 7 | //class NsTextureMan 8 | //{ 9 | // NsTexture * _add ( NsTexture * pTexture, unsigned int copy ); 10 | // 11 | // NsTexture ** m_pHashTable; 12 | // unsigned int m_tableSize; 13 | // unsigned int m_allocatedCount; 14 | //public: 15 | // NsTextureMan (); 16 | // NsTextureMan ( int hashTableSize ); 17 | // NsTextureMan ( const char * pFilename ); 18 | // ~NsTextureMan (); 19 | // 20 | // NsTexture * add ( NsTexture * pTexture ); 21 | // NsTexture * addClone ( NsTexture * pTexture ); 22 | // void remove ( const char * pName ); 23 | // void replace ( const char * pName, NsTexture *pReplacement ); 24 | // NsTexture * retrieve ( const char * pName ); 25 | // void addList ( void * pTexList ); 26 | // 27 | // unsigned int count ( void ) { return m_allocatedCount; }; 28 | // 29 | // void reset ( void ); 30 | // 31 | // void merge ( NsTextureMan& source ); 32 | //}; 33 | // 34 | //#endif // _TEXMAN_H_ 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_triangle.h: -------------------------------------------------------------------------------- 1 | //#ifndef _TRIANGLE_H_ 2 | //#define _TRIANGLE_H_ 3 | // 4 | //#include "p_hw.h" 5 | //#include "p_matrix.h" 6 | // 7 | //class NsTriangle 8 | //{ 9 | // NsVector m_corner[3]; 10 | //public: 11 | // NsTriangle (); 12 | // NsTriangle ( NsVector * pCorner0, NsVector * pCorner1, NsVector * pCorner2 ); 13 | // NsTriangle ( float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2 ); 14 | // 15 | // void translate ( NsVector * pTrans ); 16 | // 17 | // void set ( NsVector * pCorner0, NsVector * pCorner1, NsVector * pCorner2 ); 18 | // void set ( float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2 ); 19 | // 20 | // NsVector * corner ( int c ) { return &m_corner[c]; } 21 | //}; 22 | // 23 | //class NsLine 24 | //{ 25 | //public: 26 | // NsVector start; 27 | // NsVector end; 28 | // 29 | // int intersectTriangle ( float * distance, NsTriangle * pTriangle ); 30 | //}; 31 | // 32 | //typedef struct { 33 | // NsVector center; 34 | // float radius; 35 | //} NsSphere; 36 | // 37 | //#endif // _TRIANGLE_H_ 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Code/Sys/ngc/p_vector.h: -------------------------------------------------------------------------------- 1 | #ifndef _VECTOR_H_ 2 | #define _VECTOR_H_ 3 | 4 | #include 5 | 6 | class NsVector 7 | { 8 | public: 9 | float x; 10 | float y; 11 | float z; 12 | 13 | NsVector (); 14 | NsVector ( float sx, float sy, float sz ); 15 | 16 | void add ( NsVector& a ); 17 | void add ( NsVector& a, NsVector& b ); 18 | void cross ( NsVector& a ); 19 | void cross ( NsVector& a, NsVector& b ); 20 | float length ( void ); 21 | float distance ( NsVector& a ); 22 | float dot ( NsVector& a ); 23 | void normalize ( void ); 24 | void normalize ( NsVector& a ); 25 | void reflect ( NsVector& normal ); 26 | void reflect ( NsVector& a, NsVector& normal ); 27 | void scale ( float scale ); 28 | void scale ( NsVector& a, float scale ); 29 | void sub ( NsVector& a ); 30 | void sub ( NsVector& a, NsVector& b ); 31 | void lerp ( NsVector& a, NsVector& b, float t ); 32 | 33 | void set ( float sx, float sy, float sz ) { x = sx; y = sy; z = sz; } 34 | 35 | void copy ( NsVector& pSource ) { x = pSource.x; y = pSource.y; z = pSource.z; } 36 | }; 37 | 38 | #endif // _VECTOR_H_ 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tony Hawk's Underground 2 | 3 | **Platform:** Xbox, Win32, Gamecube, Playstation 2 4 | **Game:** Tony Hawk's Underground 5 | **Type:** Source Code - Incomplete / Unbuildable. 6 | **Source:** https://github.com/thug1src/thug 7 | --------------------------------------------------------------------------------