├── LICENSE
├── README.md
├── bin
├── .gitignore
└── openvr_api.dll
└── src
├── animation.h
├── cache.h
├── camera.h
├── character.h
├── collision.h
├── controller.h
├── core.h
├── debug.h
├── enemy.h
├── extension.h
├── fixed
├── camera.h
├── common.cpp
├── common.h
├── draw.h
├── enemy.h
├── fmt
│ ├── phd.h
│ └── pkd.h
├── game.h
├── inventory.h
├── item.h
├── lang
│ └── en.h
├── lara.h
├── level.h
├── nav.h
├── object.h
├── render
│ └── gl1.cpp
├── room.h
└── stream.h
├── format.h
├── frustum.h
├── game.h
├── gameflow.h
├── gapi
├── c3d.h
├── d3d11.h
├── d3d8.h
├── d3d9.h
├── gl.h
├── gu.h
├── gxm.h
├── sw.h
└── vk.h
├── gltf.h
├── input.h
├── inventory.h
├── json.h
├── lang.h
├── lang
├── cn.h
├── convert.bat
├── cz.h
├── de.h
├── en.h
├── es.h
├── fi.h
├── fr.h
├── glyph_cn.bmp
├── glyph_cn.h
├── glyph_gr.bmp
├── glyph_gr.h
├── glyph_ja.bmp
├── glyph_ja.h
├── glyph_ru.h
├── glyph_ru.png
├── gr.h
├── hu.h
├── it.h
├── ja.h
├── pl.h
├── pt.h
├── ru.h
└── sv.h
├── lara.h
├── level.h
├── libs
├── gl
│ ├── glext.h
│ └── wglext.h
├── minimp3
│ ├── minimp3.cpp
│ └── minimp3.h
├── openvr
│ └── openvr.h
├── stb_vorbis
│ └── stb_vorbis.c
└── tinf
│ ├── tinf.h
│ └── tinflate.c
├── mesh.h
├── napi_dummy.h
├── napi_socket.h
├── network.h
├── objects.h
├── platform
├── 32x
│ ├── 32x.h
│ ├── Makefile
│ ├── asm
│ │ ├── block_prepare.s
│ │ ├── block_render.s
│ │ ├── common.i
│ │ ├── data.s
│ │ ├── faceAddMeshQuads.i
│ │ ├── faceAddMeshTriangles.i
│ │ ├── faceAddRoomQuads.i
│ │ ├── faceAddRoomTriangles.i
│ │ ├── getSector.s
│ │ ├── matrixLerp.s
│ │ ├── matrixPush.s
│ │ ├── matrixRotate.s
│ │ ├── matrixSetBasis.s
│ │ ├── matrixSetIdentity.s
│ │ ├── matrixTranslate.s
│ │ ├── rasterize.i
│ │ ├── rasterizeF.i
│ │ ├── rasterizeFT.i
│ │ ├── rasterizeGT.i
│ │ ├── rasterizeS.i
│ │ ├── rasterize_dummy.i
│ │ ├── transformMesh.i
│ │ └── transformRoom.i
│ ├── crt0.s
│ ├── data
│ │ ├── GYM.PKD
│ │ ├── LEVEL1.PKD
│ │ └── LEVEL2.PKD
│ ├── deploy.sh
│ ├── main.cpp
│ ├── rasterizer.h
│ ├── render.cpp
│ ├── sound.cpp
│ └── src-md
│ │ ├── Makefile
│ │ ├── cd.s
│ │ ├── crt0.s
│ │ ├── kos.s
│ │ └── main.c
├── 3do
│ ├── CD
│ │ ├── AppStartup
│ │ ├── System
│ │ │ ├── Audio
│ │ │ │ ├── aiff
│ │ │ │ │ └── sinewave.aiff
│ │ │ │ └── dsp
│ │ │ │ │ ├── add.dsp
│ │ │ │ │ ├── adpcmduck22s.dsp
│ │ │ │ │ ├── adpcmhalfmono.dsp
│ │ │ │ │ ├── adpcmmono.dsp
│ │ │ │ │ ├── adpcmvarmono.dsp
│ │ │ │ │ ├── benchmark.dsp
│ │ │ │ │ ├── dcsqxdhalfmono.dsp
│ │ │ │ │ ├── dcsqxdhalfstereo.dsp
│ │ │ │ │ ├── dcsqxdmono.dsp
│ │ │ │ │ ├── dcsqxdstereo.dsp
│ │ │ │ │ ├── dcsqxdvarmono.dsp
│ │ │ │ │ ├── decodeadpcm.dsp
│ │ │ │ │ ├── deemphcd.dsp
│ │ │ │ │ ├── delay1tap.dsp
│ │ │ │ │ ├── delaymono.dsp
│ │ │ │ │ ├── delaystereo.dsp
│ │ │ │ │ ├── directin.dsp
│ │ │ │ │ ├── directout.dsp
│ │ │ │ │ ├── envelope.dsp
│ │ │ │ │ ├── envfollower.dsp
│ │ │ │ │ ├── ezflix225.dsp
│ │ │ │ │ ├── filterednoise.dsp
│ │ │ │ │ ├── fixedmono8.dsp
│ │ │ │ │ ├── fixedmonosample.dsp
│ │ │ │ │ ├── fixedstereo16swap.dsp
│ │ │ │ │ ├── fixedstereo8.dsp
│ │ │ │ │ ├── fixedstereosample.dsp
│ │ │ │ │ ├── halfmono8.dsp
│ │ │ │ │ ├── halfmonosample.dsp
│ │ │ │ │ ├── halfstereo8.dsp
│ │ │ │ │ ├── halfstereosample.dsp
│ │ │ │ │ ├── head.dsp
│ │ │ │ │ ├── impulse.dsp
│ │ │ │ │ ├── maximum.dsp
│ │ │ │ │ ├── minimum.dsp
│ │ │ │ │ ├── mixer12x2.dsp
│ │ │ │ │ ├── mixer2x2.dsp
│ │ │ │ │ ├── mixer4x2.dsp
│ │ │ │ │ ├── mixer8x2.dsp
│ │ │ │ │ ├── mixer8x2amp.dsp
│ │ │ │ │ ├── monitor.dsp
│ │ │ │ │ ├── multiply.dsp
│ │ │ │ │ ├── noise.dsp
│ │ │ │ │ ├── oscupdownfp.dsp
│ │ │ │ │ ├── probe.dsp
│ │ │ │ │ ├── pulse.dsp
│ │ │ │ │ ├── pulse_lfo.dsp
│ │ │ │ │ ├── pulser.dsp
│ │ │ │ │ ├── randomhold.dsp
│ │ │ │ │ ├── rednoise.dsp
│ │ │ │ │ ├── romhead.dsp
│ │ │ │ │ ├── romtail.dsp
│ │ │ │ │ ├── sampler.dsp
│ │ │ │ │ ├── sampler3d.dsp
│ │ │ │ │ ├── samplerenv.dsp
│ │ │ │ │ ├── samplermod.dsp
│ │ │ │ │ ├── sawenv.dsp
│ │ │ │ │ ├── sawenvsvfenv.dsp
│ │ │ │ │ ├── sawfilterednoise.dsp
│ │ │ │ │ ├── sawfilteredsaw.dsp
│ │ │ │ │ ├── sawtooth.dsp
│ │ │ │ │ ├── splitexec.dsp
│ │ │ │ │ ├── square.dsp
│ │ │ │ │ ├── square_lfo.dsp
│ │ │ │ │ ├── submixer2x2.dsp
│ │ │ │ │ ├── submixer4x2.dsp
│ │ │ │ │ ├── submixer8x2.dsp
│ │ │ │ │ ├── subtract.dsp
│ │ │ │ │ ├── svfilter.dsp
│ │ │ │ │ ├── tail.dsp
│ │ │ │ │ ├── tapoutput.dsp
│ │ │ │ │ ├── timesplus.dsp
│ │ │ │ │ ├── triangle.dsp
│ │ │ │ │ ├── triangle_lfo.dsp
│ │ │ │ │ ├── varmono16.dsp
│ │ │ │ │ ├── varmono8.dsp
│ │ │ │ │ └── varmono8_s.dsp
│ │ │ ├── Daemons
│ │ │ │ └── junk
│ │ │ ├── Devices
│ │ │ │ ├── FMV
│ │ │ │ │ ├── CL45016Bit.UCode
│ │ │ │ │ ├── CL45024Bit.UCode
│ │ │ │ │ └── CL450Boot.UCode
│ │ │ │ ├── FMVVIDEODEVICE.PRIVDEVICE
│ │ │ │ └── ns.privdevice
│ │ │ ├── Drivers
│ │ │ │ ├── cport1.rom
│ │ │ │ ├── cport41.rom
│ │ │ │ ├── cport49.rom
│ │ │ │ ├── cport4d.rom
│ │ │ │ ├── languages
│ │ │ │ │ ├── da.language
│ │ │ │ │ ├── de.language
│ │ │ │ │ ├── es.language
│ │ │ │ │ ├── fr.language
│ │ │ │ │ ├── it.language
│ │ │ │ │ ├── ja.language
│ │ │ │ │ ├── nl.language
│ │ │ │ │ └── pt.language
│ │ │ │ └── tuners
│ │ │ │ │ └── access.tuner
│ │ │ ├── Folios
│ │ │ │ ├── audio.privfolio
│ │ │ │ ├── compression.folio
│ │ │ │ ├── debugger.privfolio
│ │ │ │ ├── graphics.privfolio
│ │ │ │ ├── international.privfolio
│ │ │ │ ├── international
│ │ │ │ │ └── CountryDatabase
│ │ │ │ ├── jstring.folio
│ │ │ │ └── operamath.privfolio
│ │ │ ├── Graphics
│ │ │ │ └── Fonts
│ │ │ │ │ └── Kanji16.4
│ │ │ ├── Kernel
│ │ │ │ ├── boot_code
│ │ │ │ ├── misc_code
│ │ │ │ └── os_code
│ │ │ ├── Programs
│ │ │ │ ├── copy
│ │ │ │ ├── delete
│ │ │ │ ├── dismount
│ │ │ │ ├── eeprom
│ │ │ │ ├── format
│ │ │ │ ├── fscheck
│ │ │ │ ├── gdbug
│ │ │ │ ├── lmadm
│ │ │ │ ├── lmdump
│ │ │ │ ├── ls
│ │ │ │ ├── mount
│ │ │ │ ├── sysload
│ │ │ │ ├── type
│ │ │ │ ├── walker
│ │ │ │ └── what
│ │ │ ├── Scripts
│ │ │ │ └── startopera
│ │ │ └── Tasks
│ │ │ │ ├── eventbroker
│ │ │ │ └── shell
│ │ ├── rom_tags
│ │ └── signatures
│ ├── Makefile
│ ├── banner.bmp
│ ├── boxIsVisible.s
│ ├── boxRotateYQ.s
│ ├── boxTranslate.s
│ ├── common_asm.inc
│ ├── faceAddMeshQuads.s
│ ├── faceAddMeshQuadsFlat.s
│ ├── faceAddMeshTriangles.s
│ ├── faceAddMeshTrianglesFlat.s
│ ├── faceAddRoomQuads.s
│ ├── faceAddRoomTriangles.s
│ ├── main.cpp
│ ├── matrixLerp.s
│ ├── matrixPush.s
│ ├── matrixRotate.s
│ ├── matrixSetBasis.s
│ ├── matrixSetIdentity.s
│ ├── matrixTranslate.s
│ ├── projectVertices.s
│ ├── render_cel.cpp
│ ├── sound.cpp
│ ├── sphereIsVisible.s
│ ├── unpackMesh.s
│ └── unpackRoom.s
├── 3ds
│ ├── Makefile
│ ├── deploy.sh
│ ├── icon.png
│ └── main.cpp
├── android
│ ├── app
│ │ ├── CMakeLists.txt
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── cpp
│ │ │ └── main.cpp
│ │ │ ├── java
│ │ │ └── org
│ │ │ │ └── xproger
│ │ │ │ └── openlara
│ │ │ │ └── MainActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ ├── banner.png
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── strings.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── native_wip
│ │ ├── AndroidManifest.xml
│ │ ├── android_native_app_glue.c
│ │ ├── android_native_app_glue.h
│ │ └── main.cpp
│ └── settings.gradle
├── bittboy
│ ├── build.sh
│ ├── build_miyoo.sh
│ └── main.cpp
├── clover
│ ├── build.sh
│ └── main.cpp
├── dos
│ ├── DOS4GW.exe
│ ├── deploy.bat
│ ├── dosbox.conf
│ ├── main.cpp
│ ├── rasterizer.h
│ └── sound.cpp
├── gba
│ ├── IMGS
│ │ └── O
│ │ │ └── P
│ │ │ └── OPLA.bmp
│ ├── Makefile
│ ├── OpenLara.sln
│ ├── OpenLara.vcxproj
│ ├── asm
│ │ ├── boxRotateYQ.s
│ │ ├── boxTranslate.s
│ │ ├── clearFB.s
│ │ ├── common_asm.inc
│ │ ├── faceAddMeshQuads.s
│ │ ├── faceAddMeshTriangles.s
│ │ ├── faceAddRoomQuads.s
│ │ ├── faceAddRoomTriangles.s
│ │ ├── flush.s
│ │ ├── getSector.s
│ │ ├── matrixFrame.s
│ │ ├── matrixLerp.s
│ │ ├── matrixPush.s
│ │ ├── matrixRotate.s
│ │ ├── matrixSetBasis.s
│ │ ├── matrixSetIdentity.s
│ │ ├── matrixTranslate.s
│ │ ├── rasterize.s
│ │ ├── rasterizeF.s
│ │ ├── rasterizeFT.s
│ │ ├── rasterizeFTA.s
│ │ ├── rasterizeFillS.s
│ │ ├── rasterizeGT.s
│ │ ├── rasterizeGTA.s
│ │ ├── rasterizeLineH.s
│ │ ├── rasterizeLineV.s
│ │ ├── rasterizeS.s
│ │ ├── rasterize_dummy.s
│ │ ├── sdiv32.s
│ │ ├── sndAD4.s
│ │ ├── sndPCM.s
│ │ ├── sphereIsVisible.s
│ │ ├── transformMesh.s
│ │ ├── transformRoom.s
│ │ ├── transformRoomUW.s
│ │ └── udiv32.s
│ ├── checkROM.cpp
│ ├── data
│ │ ├── GYM.PKD
│ │ ├── LEVEL1.PKD
│ │ ├── LEVEL2.PKD
│ │ ├── TITLE.PKD
│ │ ├── TITLE.SCR
│ │ └── TRACKS.AD4
│ ├── deploy.sh
│ ├── labels.png
│ ├── main.cpp
│ ├── packer
│ │ ├── IMA.h
│ │ ├── TR1_PC.h
│ │ ├── TR1_PSX.h
│ │ ├── ad4
│ │ │ ├── AD4.h
│ │ │ └── ad4.c
│ │ ├── common.h
│ │ ├── libimagequant
│ │ │ ├── blur.c
│ │ │ ├── blur.h
│ │ │ ├── kmeans.c
│ │ │ ├── kmeans.h
│ │ │ ├── libimagequant.c
│ │ │ ├── libimagequant.h
│ │ │ ├── mediancut.c
│ │ │ ├── mediancut.h
│ │ │ ├── mempool.c
│ │ │ ├── mempool.h
│ │ │ ├── nearest.c
│ │ │ ├── nearest.h
│ │ │ ├── pam.c
│ │ │ └── pam.h
│ │ ├── main.cpp
│ │ ├── out_32X.h
│ │ ├── out_3DO.h
│ │ ├── out_GBA.h
│ │ ├── packer.sln
│ │ ├── packer.vcxproj
│ │ ├── packer.vcxproj.filters
│ │ ├── stb_image_resize.h
│ │ └── tracks
│ │ │ ├── ad4.exe
│ │ │ ├── convert.bat
│ │ │ ├── convertToMono.bat
│ │ │ ├── cygwin1.dll
│ │ │ └── poly2mono.exe
│ ├── rasterizer.h
│ ├── render.iwram.cpp
│ └── sound.cpp
├── gcw0
│ ├── build.sh
│ ├── icon.png
│ ├── main.cpp
│ └── make_opk.sh
├── ios
│ ├── AppDelegate.h
│ ├── AppDelegate.mm
│ ├── Default-568h@2x.png
│ ├── ViewController.h
│ ├── ViewController.mm
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── main.m
│ ├── openlara-Info.plist
│ ├── openlara-Prefix.pch
│ └── openlara.xcodeproj
│ │ └── project.pbxproj
├── nix
│ ├── .vscode
│ │ ├── OpenLara.code-workspace
│ │ ├── c_cpp_properties.json
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ ├── build.sh
│ ├── build_e2k.sh
│ ├── howto.txt
│ ├── main.cpp
│ └── premake5.lua
├── nx
│ ├── Makefile
│ ├── deploy.bat
│ ├── icon.jpg
│ └── main.cpp
├── osx
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── icon128x128.png
│ │ │ ├── icon16x16@2x.png
│ │ │ ├── icon256x256.png
│ │ │ ├── icon32x32@2x.png
│ │ │ └── icon512x512.png
│ ├── OpenLara-Info.plist
│ ├── OpenLara.xcodeproj
│ │ └── project.pbxproj
│ ├── main.mm
│ └── main_carbon_old.cpp
├── psc
│ ├── build.sh
│ └── main.cpp
├── psp
│ ├── ICON0.PNG
│ ├── Makefile
│ ├── PIC1.PNG
│ └── main.cpp
├── psv
│ ├── CMakeLists.txt
│ ├── debugScreen.h
│ ├── debugScreenFont.c
│ ├── deploy.bat
│ ├── deploy.sh
│ ├── main.cpp
│ └── sce_sys
│ │ ├── icon0.png
│ │ └── livearea
│ │ └── contents
│ │ ├── bg.png
│ │ ├── startup.png
│ │ └── template.xml
├── rpi
│ ├── Makefile
│ ├── build.sh
│ └── main.cpp
├── sdl2
│ ├── Makefile
│ ├── build.sh
│ └── main.cpp
├── tns
│ ├── Makefile
│ ├── main.cpp
│ └── sound.cpp
├── web
│ ├── .htaccess
│ ├── build.bat
│ ├── build_wasm.bat
│ ├── index.php
│ ├── level
│ │ └── .htaccess
│ └── main.cpp
├── win
│ ├── OpenLara.rc
│ ├── OpenLara.sln
│ ├── OpenLara.vcxproj
│ ├── OpenLara.vcxproj.filters
│ ├── OpenLara.vcxproj.user
│ ├── compile_mingw.bat
│ ├── icon.ico
│ ├── main.cpp
│ └── wcrt.lib
├── win_fixed
│ ├── OpenLara.rc
│ ├── OpenLara.sln
│ ├── OpenLara.vcxproj
│ ├── OpenLara.vcxproj.filters
│ ├── icon.ico
│ ├── main.cpp
│ └── sound.cpp
├── wp8
│ ├── OpenLara.sln
│ ├── OpenLara.vcxproj
│ ├── OpenLara.vcxproj.filters
│ ├── WMAppManifest.xml
│ └── main.cpp
├── xb1
│ ├── Assets
│ │ ├── LargeTile.scale-200.png
│ │ ├── SmallTile.scale-200.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.targetsize-48.png
│ │ ├── StoreLogo.scale-200.png
│ │ └── Wide310x150Logo.scale-200.png
│ ├── OpenLara.sln
│ ├── OpenLara.vcxproj
│ ├── OpenLara.vcxproj.filters
│ ├── OpenLara.vcxproj.user
│ ├── OpenLara_TemporaryKey.pfx
│ ├── Package.StoreAssociation.xml
│ ├── Package.appxmanifest
│ └── main.cpp
└── xbox
│ ├── OpenLara.sln
│ ├── OpenLara.vcproj
│ ├── main.cpp
│ ├── saveimage.xbx
│ └── titleimage.xbx
├── savegame.h
├── shader.h
├── shaders
├── ambient.glsl
├── ambient_room.asm
├── ambient_room.hlsl
├── ambient_sprite.asm
├── ambient_sprite.hlsl
├── clear.hlsl
├── common.asm
├── common.hlsl
├── compile_d3d11.bat
├── compile_d3d11_wp8.bat
├── compile_d3d8.bat
├── compile_d3d9.bat
├── compile_gxm.bat
├── compose.glsl
├── compose_entity.asm
├── compose_entity.hlsl
├── compose_flash.asm
├── compose_flash.hlsl
├── compose_mirror.asm
├── compose_mirror.hlsl
├── compose_room.asm
├── compose_room.hlsl
├── compose_sprite.asm
├── compose_sprite.hlsl
├── dummy.hlsl
├── filter.asm
├── filter.glsl
├── filter.hlsl
├── gui.asm
├── gui.glsl
├── gui.hlsl
├── pica
│ ├── ambient_room.v.pica
│ ├── ambient_sprite.v.pica
│ ├── compose_entity.v.pica
│ ├── compose_entity_u.v.pica
│ ├── compose_flash.v.pica
│ ├── compose_mirror.v.pica
│ ├── compose_room.v.pica
│ ├── compose_room_u.v.pica
│ ├── compose_sprite.v.pica
│ ├── compose_sprite_u.v.pica
│ ├── dummy.v.pica
│ ├── filter_upscale.v.pica
│ ├── gui.v.pica
│ └── shadow_entity.v.pica
├── shadow.glsl
├── shadow_entity.asm
├── shadow_entity.hlsl
├── sky.glsl
├── sky.hlsl
├── water.glsl
├── water_caustics.hlsl
├── water_compose.hlsl
├── water_drop.hlsl
├── water_mask.hlsl
├── water_rays.hlsl
└── water_simulate.hlsl
├── sound.h
├── sprite.h
├── texture.h
├── tools
└── glyphs
│ ├── glyphs.sln
│ ├── glyphs.vcxproj
│ └── main.cpp
├── ui.h
├── utils.h
└── video.h
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 2-Clause License
2 |
3 | Copyright (c) 2018, Timur "XProger" Gagiev
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OpenLara
2 | Classic Tomb Raider open-source engine
3 |
4 | [WebGL build with demo level](http://xproger.info/projects/OpenLara/)
5 |
6 | [Standalone version](https://github.com/XProger/OpenLara/releases/tag/latest)
7 |
8 | [Roadmap](https://github.com/XProger/OpenLara/issues/353)
9 |
10 | [](https://opensource.org/licenses/BSD-2-Clause)
11 |
12 | ## Links
13 | [](https://twitter.com/XProger_san)
14 | [](https://discord.gg/EF8JaQB)
15 | [](https://t.me/openlara)
16 | * [YouTube channel](https://www.youtube.com/c/TimurGagiev)
17 | * [Tomb Raider Forums thread](http://www.tombraiderforums.com/showthread.php?t=216618)
18 |
19 | ## Screenshots
20 | 
21 | 
22 | 
23 | 
24 | 
25 | 
26 | 
27 | 
28 |
--------------------------------------------------------------------------------
/bin/.gitignore:
--------------------------------------------------------------------------------
1 | *.PHD
2 | *.ogg
3 | *.PSX
4 | *.PNG
5 | *.PCX
6 | *.RAW
7 | *.zip
8 | *.txt
9 |
10 |
--------------------------------------------------------------------------------
/bin/openvr_api.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/bin/openvr_api.dll
--------------------------------------------------------------------------------
/src/fixed/stream.h:
--------------------------------------------------------------------------------
1 | #ifndef H_STREAM
2 | #define H_STREAM
3 |
4 | #include "common.h"
5 |
6 | struct DataStream
7 | {
8 | const uint8* data;
9 | int32 size;
10 | int32 pos;
11 | bool bigEndian;
12 |
13 | DataStream(const uint8* data, int32 size) : data(data), size(size), pos(0), bigEndian(false)
14 | {
15 | //
16 | }
17 |
18 | const uint8* getPtr()
19 | {
20 | return data + pos;
21 | }
22 |
23 | int32 getPos()
24 | {
25 | return pos;
26 | }
27 |
28 | void setPos(int32 newPos)
29 | {
30 | pos = newPos;
31 | }
32 |
33 | void seek(int32 offset)
34 | {
35 | pos += offset;
36 | }
37 |
38 | X_INLINE uint8 read8u()
39 | {
40 | return data[pos++];
41 | }
42 |
43 | X_INLINE int8 read8s()
44 | {
45 | return (int8)read8u();
46 | }
47 |
48 | uint16 read16u()
49 | {
50 | const uint8* ptr = data + pos;
51 | pos += 2;
52 |
53 | uint16 n;
54 | if (intptr_t(ptr) & 1) {
55 | n = ptr[0] | (ptr[1] << 8);
56 | } else {
57 | n = *(uint16*)ptr;
58 | }
59 |
60 | return bigEndian ? swap16(n) : n;
61 | }
62 |
63 | X_INLINE int16 read16s()
64 | {
65 | return (int16)read16u();
66 | }
67 |
68 | uint32 read32u()
69 | {
70 | const uint8* ptr = data + pos;
71 | pos += 4;
72 |
73 | uint32 n;
74 | if (intptr_t(ptr) & 3) {
75 | n = ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
76 | } else {
77 | n = *(uint32*)ptr;
78 | }
79 |
80 | return bigEndian ? swap32(n) : n;
81 | }
82 |
83 | X_INLINE int32 read32s()
84 | {
85 | return (int32)read32u();
86 | }
87 | };
88 |
89 | #endif
90 |
--------------------------------------------------------------------------------
/src/gapi/vk.h:
--------------------------------------------------------------------------------
1 | #ifndef H_GAPI_VK
2 | #define H_GAPI_VK
3 |
4 | // TODO
5 |
6 | #endif
--------------------------------------------------------------------------------
/src/lang.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/lang.h
--------------------------------------------------------------------------------
/src/lang/convert.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | ..\shaders\bin2c.exe glyph_ru.png glyph_ru.h GLYPH_RU
3 | ..\shaders\bin2c.exe glyph_ja.bmp glyph_ja.h GLYPH_JA
4 | ..\shaders\bin2c.exe glyph_gr.bmp glyph_gr.h GLYPH_GR
5 | ..\shaders\bin2c.exe glyph_cn.bmp glyph_cn.h GLYPH_CN
6 |
--------------------------------------------------------------------------------
/src/lang/glyph_cn.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/lang/glyph_cn.bmp
--------------------------------------------------------------------------------
/src/lang/glyph_gr.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/lang/glyph_gr.bmp
--------------------------------------------------------------------------------
/src/lang/glyph_ja.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/lang/glyph_ja.bmp
--------------------------------------------------------------------------------
/src/lang/glyph_ru.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/lang/glyph_ru.png
--------------------------------------------------------------------------------
/src/lang/ru.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/lang/ru.h
--------------------------------------------------------------------------------
/src/libs/minimp3/minimp3.h:
--------------------------------------------------------------------------------
1 | #ifndef __MINIMP3_H_INCLUDED__
2 | #define __MINIMP3_H_INCLUDED__
3 |
4 | typedef struct _mp3_info {
5 | int sample_rate;
6 | int channels;
7 | int audio_bytes; // generated amount of audio per frame
8 | } mp3_info_t;
9 |
10 | typedef void* mp3_decoder_t;
11 |
12 | mp3_decoder_t mp3_create(void);
13 | extern int mp3_decode(mp3_decoder_t dec, void *buf, int bytes, signed short *out, mp3_info_t *info);
14 | void mp3_done(mp3_decoder_t dec);
15 | int mp3_decode_init();
16 | void mp3_decode_free();
17 |
18 | #endif//__MINIMP3_H_INCLUDED__
19 |
--------------------------------------------------------------------------------
/src/libs/openvr/openvr.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/libs/openvr/openvr.h
--------------------------------------------------------------------------------
/src/libs/tinf/tinf.h:
--------------------------------------------------------------------------------
1 | /*
2 | * tinf - tiny inflate library (inflate, gzip, zlib)
3 | *
4 | * version 1.00
5 | *
6 | * Copyright (c) 2003 by Joergen Ibsen / Jibz
7 | * All Rights Reserved
8 | *
9 | * http://www.ibsensoftware.com/
10 | */
11 |
12 | #ifndef TINF_H_INCLUDED
13 | #define TINF_H_INCLUDED
14 |
15 | /* calling convention */
16 | #ifndef TINFCC
17 | #ifdef __WATCOMC__
18 | #define TINFCC __cdecl
19 | #else
20 | #define TINFCC
21 | #endif
22 | #endif
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | #define TINF_OK 0
29 | #define TINF_DATA_ERROR (-3)
30 |
31 | /* function prototypes */
32 |
33 | void TINFCC tinf_init();
34 |
35 | int TINFCC tinf_uncompress(void *dest, unsigned int *destLen,
36 | const void *source, unsigned int sourceLen);
37 |
38 | int TINFCC tinf_gzip_uncompress(void *dest, unsigned int *destLen,
39 | const void *source, unsigned int sourceLen);
40 |
41 | int TINFCC tinf_zlib_uncompress(void *dest, unsigned int *destLen,
42 | const void *source, unsigned int sourceLen);
43 |
44 | unsigned int TINFCC tinf_adler32(const void *data, unsigned int length);
45 |
46 | unsigned int TINFCC tinf_crc32(const void *data, unsigned int length);
47 |
48 | #ifdef __cplusplus
49 | } /* extern "C" */
50 | #endif
51 |
52 | #endif /* TINF_H_INCLUDED */
53 |
--------------------------------------------------------------------------------
/src/napi_dummy.h:
--------------------------------------------------------------------------------
1 | #ifndef H_NAPI_DUMMY
2 | #define H_NAPI_DUMMY
3 |
4 | #include "utils.h"
5 |
6 | namespace NAPI {
7 | typedef int Peer;
8 |
9 | void init() {}
10 | void deinit() {}
11 | void listen(uint16 port) {}
12 | int send(const Peer &to, const void *data, int size) { return 0; }
13 | int recv(Peer &from, void *data, int size) { return 0; }
14 | void broadcast(const void *data, int size) {}
15 | }
16 |
17 | #endif
--------------------------------------------------------------------------------
/src/platform/32x/asm/block_prepare.s:
--------------------------------------------------------------------------------
1 | #include "common.i"
2 | .data
3 |
4 | .global _block_prepare_start
5 | .global _block_prepare_end
6 |
7 | .align 4
8 | _block_prepare_start:
9 |
10 | #include "transformMesh.i"
11 | #include "transformRoom.i"
12 |
13 | .align 2
14 | var_gVerticesBase:
15 | .long _gVerticesBase
16 | var_gMatrixPtr:
17 | .long _gMatrixPtr
18 | var_gLightAmbient:
19 | .long _gLightAmbient
20 | var_divTable:
21 | .long _divTable
22 | var_viewportRel:
23 | .long _viewportRel
24 |
25 | #include "faceAddMeshQuads.i"
26 | #include "faceAddMeshTriangles.i"
27 |
28 | .align 2
29 | var_gVertices_fam:
30 | .long _gVertices
31 | var_gFacesBase_fam:
32 | .long _gFacesBase
33 | var_gVerticesBase_fam:
34 | .long _gVerticesBase
35 | const_FACE_CLIPPED_fam:
36 | .long FACE_CLIPPED
37 | const_FACE_TRIANGLE_fam:
38 | .long FACE_TRIANGLE
39 | var_gOT_fam:
40 | .long _gOT
41 |
42 | #include "faceAddRoomQuads.i"
43 | #include "faceAddRoomTriangles.i"
44 |
45 | .align 2
46 | var_gVertices_far:
47 | .long _gVertices
48 | var_gFacesBase_far:
49 | .long _gFacesBase
50 | var_gVerticesBase_far:
51 | .long _gVerticesBase
52 | const_FACE_CLIPPED_far:
53 | .long FACE_CLIPPED
54 | const_FACE_GOURAUD_far:
55 | .long FACE_GOURAUD
56 | const_FACE_TRIANGLE_far:
57 | .long FACE_TRIANGLE
58 | var_gOT_far:
59 | .long _gOT
60 |
61 | _block_prepare_end:
62 |
--------------------------------------------------------------------------------
/src/platform/32x/asm/block_render.s:
--------------------------------------------------------------------------------
1 | #include "common.i"
2 | .data
3 |
4 | .global _block_render_start
5 | .global _block_render_end
6 |
7 | .align 4
8 | _block_render_start:
9 |
10 | #include "rasterize.i"
11 | //#include "rasterize_dummy.i"
12 | #include "rasterizeS.i"
13 | #include "rasterizeF.i"
14 |
15 | .align 2
16 | var_LMAP_ADDR_fs:
17 | .long _gLightmap_base
18 | var_divTable_fs:
19 | .long _divTable
20 | var_frameWidth_fs:
21 | .word FRAME_WIDTH
22 |
23 | #include "rasterizeFT.i"
24 | #include "rasterizeGT.i"
25 |
26 | .align 2
27 | var_LMAP_ADDR:
28 | .long _gLightmap_base
29 | var_divTable:
30 | .long _divTable
31 | var_mask:
32 | .word 0xFF00
33 | var_frameWidth:
34 | .word FRAME_WIDTH
35 |
36 | _block_render_end:
37 |
--------------------------------------------------------------------------------
/src/platform/32x/asm/data.s:
--------------------------------------------------------------------------------
1 | .text
2 | /*
3 | .global _TITLE_PKD
4 | .align 4
5 | _TITLE_PKD:
6 | .long TITLE
7 | TITLE:
8 | .incbin "data/TITLE.PKD"
9 | */
10 | .global _LEVEL1_PKD
11 | .align 4
12 | _LEVEL1_PKD:
13 | .long LEVEL1
14 | LEVEL1:
15 | .incbin "data/LEVEL1.PKD"
16 |
17 | .align 4
18 |
--------------------------------------------------------------------------------
/src/platform/32x/asm/getSector.s:
--------------------------------------------------------------------------------
1 | #include "common.i"
2 | SEG_PHYSICS
3 |
4 | #define sectors r0
5 | #define info r1
6 | #define roomX r2
7 | #define roomZ r3
8 | #define this r4 // arg
9 | #define x r5 // arg
10 | #define z r6 // arg
11 | #define mask r7
12 | #define sectorsX roomX
13 | #define sectorsZ roomZ
14 | #define offset sectorsZ
15 |
16 | .text
17 | .align 4
18 | .global __ZNK4Room9getSectorEii
19 | __ZNK4Room9getSectorEii:
20 | mov.l @(4, this), info
21 | mov.w @info+, roomX
22 | mov.w @info+, roomZ
23 |
24 | add #16, info // offset to [sectorsX, sectorsZ]
25 |
26 | .getX: // x = MIN(MAX(x - (roomX << 8), 0) >> 10, sectorsX - 1)
27 | shll8 roomX
28 | sub roomX, x
29 | mov.b @info+, sectorsX
30 | cmp/pz x
31 | subc mask, mask
32 | and mask, x
33 | shlr8 x
34 | shlr2 x
35 | cmp/ge sectorsX, x
36 | bf/s .getZ
37 | add #-1, sectorsX
38 | mov sectorsX, x
39 |
40 | .getZ: // z = MIN(MAX(z - (roomZ << 8), 0) >> 10, sectorsZ - 1)
41 | shll8 roomZ
42 | sub roomZ, z
43 | mov.b @info+, sectorsZ
44 | cmp/pz z
45 | subc mask, mask
46 | and mask, z
47 | shlr8 z
48 | shlr2 z
49 | cmp/ge sectorsZ, z
50 | bf/s .getPtr
51 | mov.l @(8, this), sectors
52 | mov sectorsZ, z
53 | add #-1, z
54 |
55 | .getPtr:
56 | // offset = sectors + ((x * sectorsZ + z) << 3)
57 | mulu.w sectorsZ, x
58 | sts MACL, x
59 | add x, z
60 | shll2 z
61 | shll z
62 | rts
63 | add z, sectors
64 |
--------------------------------------------------------------------------------
/src/platform/32x/asm/matrixPush.s:
--------------------------------------------------------------------------------
1 | #include "common.i"
2 | SEG_MATH
3 |
4 | #define ptr r0
5 | #define m r1
6 | #define e0 r2
7 | #define e1 r3
8 | #define e2 r4
9 | #define e3 r5
10 | #define e4 r6
11 | #define e5 r7
12 |
13 | .align 4
14 | .global _matrixPush_asm
15 | _matrixPush_asm:
16 | mov.l var_gMatrixPtr, ptr
17 | mov.l @ptr, m
18 |
19 | mov.l @m+, e0
20 | mov.l @m+, e1
21 | mov.l @m+, e2
22 | mov.l @m+, e3
23 | mov.l @m+, e4
24 | mov.l @m+, e5
25 |
26 | mov.l e0, @( 0, m)
27 | mov.l e1, @( 4, m)
28 | mov.l e2, @( 8, m)
29 | mov.l e3, @(12, m)
30 | mov.l e4, @(16, m)
31 | mov.l e5, @(20, m)
32 |
33 | rts
34 | mov.l m, @ptr
35 |
36 | var_gMatrixPtr:
37 | .long _gMatrixPtr
38 |
--------------------------------------------------------------------------------
/src/platform/32x/asm/matrixSetBasis.s:
--------------------------------------------------------------------------------
1 | #include "common.i"
2 | SEG_MATH
3 |
4 | #define e8 r0 // [ e22 ]
5 | #define e01 r1 // [ e00, e01 ]
6 | #define e23 r2 // [ e02, e10 ]
7 | #define e45 r3 // [ e11, e12 ]
8 | #define dst r4 // arg
9 | #define src r5 // arg
10 | #define e67 r6 // [ e20, e21 ]
11 |
12 | .align 4
13 | .global _matrixSetBasis_asm
14 | _matrixSetBasis_asm:
15 | mov.l @(M00, src), e01
16 | mov.l @(M02, src), e23
17 | mov.l @(M11, src), e45
18 | mov.l @(M20, src), e67
19 | mov.w @(M22, src), e8
20 |
21 | mov.l e01, @(M00, dst)
22 | mov.l e23, @(M02, dst)
23 | mov.l e45, @(M11, dst)
24 | mov.l e67, @(M20, dst)
25 | rts
26 | mov.w e8, @(M22, dst)
27 |
--------------------------------------------------------------------------------
/src/platform/32x/asm/matrixSetIdentity.s:
--------------------------------------------------------------------------------
1 | #include "common.i"
2 | SEG_MATH
3 |
4 | #define m r0
5 | #define ZZ r1
6 | #define NZ r2
7 |
8 | // word [ N Z Z ] // rot
9 | // [ Z N Z ] // rot
10 | // [ Z Z N ] // rot
11 | // [ Z Z Z ] // trans
12 | // long [ NZ ZZ NZ ZZ NZ ZZ ]
13 |
14 | .align 4
15 | .global _matrixSetIdentity_asm
16 | _matrixSetIdentity_asm:
17 | mov.l var_gMatrixPtr, m
18 | mov.l @m, m
19 |
20 | // ZZ = 0x 0000 0000
21 | mov #0, ZZ
22 |
23 | // NZ = 0x 4000 0000
24 | mov #64, NZ
25 | shll8 NZ
26 | shll16 NZ
27 |
28 | mov.l NZ, @( 0, m)
29 | mov.l ZZ, @( 4, m)
30 | mov.l NZ, @( 8, m)
31 | mov.l ZZ, @(12, m)
32 | mov.l NZ, @(16, m)
33 | rts
34 | mov.l ZZ, @(20, m)
35 | nop
36 |
37 | var_gMatrixPtr:
38 | .long _gMatrixPtr
39 |
--------------------------------------------------------------------------------
/src/platform/32x/asm/rasterize_dummy.i:
--------------------------------------------------------------------------------
1 | .align 4
2 | .global _rasterize_dummy
3 | _rasterize_dummy:
4 | rts
5 | nop
6 |
--------------------------------------------------------------------------------
/src/platform/32x/data/GYM.PKD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/32x/data/GYM.PKD
--------------------------------------------------------------------------------
/src/platform/32x/data/LEVEL1.PKD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/32x/data/LEVEL1.PKD
--------------------------------------------------------------------------------
/src/platform/32x/data/LEVEL2.PKD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/32x/data/LEVEL2.PKD
--------------------------------------------------------------------------------
/src/platform/32x/deploy.sh:
--------------------------------------------------------------------------------
1 | make clean
2 | make
3 | /c/RetroArch/retroarch.exe -L C:\\RetroArch\\cores\\picodrive_libretro.dll OpenLara.32x
4 |
--------------------------------------------------------------------------------
/src/platform/32x/sound.cpp:
--------------------------------------------------------------------------------
1 | #include "common.h"
2 |
3 | void sndInit()
4 | {
5 | // TODO
6 | }
7 |
8 | void sndInitSamples()
9 | {
10 | // TODO
11 | }
12 |
13 | void sndFreeSamples()
14 | {
15 | // TODO
16 | }
17 |
18 | void* sndPlaySample(int32 index, int32 volume, int32 pitch, int32 mode)
19 | {
20 | return NULL; // TODO
21 | }
22 |
23 | void sndPlayTrack(int32 track)
24 | {
25 | // TODO
26 | }
27 |
28 | void sndStopTrack()
29 | {
30 | // TODO
31 | }
32 |
33 | bool sndTrackIsPlaying()
34 | {
35 | return false; // TODO
36 | }
37 |
38 | void sndStopSample(int32 index)
39 | {
40 | // TODO
41 | }
42 |
43 | void sndStop()
44 | {
45 | // TODO
46 | }
47 |
48 | void sndFill(uint8* buffer, int32 count)
49 | {
50 | // TODO
51 | }
52 |
--------------------------------------------------------------------------------
/src/platform/32x/src-md/Makefile:
--------------------------------------------------------------------------------
1 | ifdef $(GENDEV)
2 | ROOTDIR = $(GENDEV)
3 | else
4 | ROOTDIR = /opt/toolchains/sega
5 | endif
6 |
7 | PREFIX = $(ROOTDIR)/m68k-elf/bin/m68k-elf-
8 | CC = $(PREFIX)gcc
9 | AS = $(PREFIX)as
10 | LD = $(PREFIX)ld
11 | OBJC = $(PREFIX)objcopy
12 |
13 | CC_VER := $(shell $(CC) -dumpversion)
14 |
15 | LDSCRIPTSDIR = $(ROOTDIR)/ldscripts
16 |
17 | LIBPATH = -L$(ROOTDIR)/m68k-elf/lib -L$(ROOTDIR)/m68k-elf/lib/gcc/m68k-elf/$(CC_VER) -L$(ROOTDIR)/m68k-elf/m68k-elf/lib
18 | INCPATH = -I$. -I$(ROOTDIR)/m68k-elf/include -I$(ROOTDIR)/m68k-elf/m68k-elf/include
19 |
20 | CCFLAGS = -m68000 -Wall -O1 -c -fomit-frame-pointer
21 | ASFLAGS = -m68000 --register-prefix-optional
22 | LINKFLAGS = -T $(LDSCRIPTSDIR)/mars-md.ld -Wl,-Map=output.map -nostdlib
23 |
24 | DD = dd
25 | RM = rm -f
26 |
27 | TARGET = m68k
28 | LIBS = $(LIBPATH) -lc -lgcc -lnosys
29 | OBJS = crt0.o main.o kos.o cd.o
30 |
31 | all: $(TARGET).bin
32 |
33 | $(TARGET).bin: $(TARGET).elf
34 | $(OBJC) -O binary $< $(TARGET).bin
35 |
36 | $(TARGET).elf: $(OBJS)
37 | $(CC) $(LINKFLAGS) $(OBJS) $(LIBS) -o $(TARGET).elf
38 |
39 | %.o: %.c
40 | $(CC) $(CCFLAGS) $(INCPATH) $< -o $@
41 |
42 | %.o: %.s
43 | $(AS) $(ASFLAGS) $(INCPATH) $< -o $@
44 |
45 | clean:
46 | $(RM) *.o *.bin *.elf output.map
47 |
--------------------------------------------------------------------------------
/src/platform/3do/CD/AppStartup:
--------------------------------------------------------------------------------
1 | #minmem
2 | # show CPU, DRAM, VRAM and DSP usage
3 | #$c/sysload
4 |
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/aiff/sinewave.aiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/aiff/sinewave.aiff
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/add.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/add.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/adpcmduck22s.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/adpcmduck22s.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/adpcmhalfmono.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/adpcmhalfmono.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/adpcmmono.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/adpcmmono.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/adpcmvarmono.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/adpcmvarmono.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/benchmark.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/benchmark.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/dcsqxdhalfmono.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/dcsqxdhalfmono.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/dcsqxdhalfstereo.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/dcsqxdhalfstereo.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/dcsqxdmono.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/dcsqxdmono.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/dcsqxdstereo.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/dcsqxdstereo.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/dcsqxdvarmono.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/dcsqxdvarmono.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/decodeadpcm.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/decodeadpcm.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/deemphcd.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/deemphcd.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/delay1tap.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/delay1tap.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/delaymono.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/delaymono.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/delaystereo.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/delaystereo.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/directin.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/directin.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/directout.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/directout.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/envelope.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/envelope.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/envfollower.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/envfollower.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/ezflix225.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/ezflix225.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/filterednoise.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/filterednoise.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/fixedmono8.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/fixedmono8.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/fixedmonosample.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/fixedmonosample.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/fixedstereo16swap.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/fixedstereo16swap.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/fixedstereo8.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/fixedstereo8.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/fixedstereosample.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/fixedstereosample.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/halfmono8.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/halfmono8.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/halfmonosample.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/halfmonosample.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/halfstereo8.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/halfstereo8.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/halfstereosample.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/halfstereosample.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/head.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/head.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/impulse.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/impulse.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/maximum.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/maximum.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/minimum.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/minimum.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/mixer12x2.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/mixer12x2.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/mixer2x2.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/mixer2x2.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/mixer4x2.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/mixer4x2.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/mixer8x2.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/mixer8x2.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/mixer8x2amp.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/mixer8x2amp.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/monitor.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/monitor.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/multiply.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/multiply.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/noise.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/noise.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/oscupdownfp.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/oscupdownfp.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/probe.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/probe.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/pulse.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/pulse.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/pulse_lfo.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/pulse_lfo.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/pulser.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/pulser.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/randomhold.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/randomhold.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/rednoise.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/rednoise.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/romhead.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/romhead.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/romtail.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/romtail.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/sampler.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/sampler.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/sampler3d.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/sampler3d.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/samplerenv.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/samplerenv.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/samplermod.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/samplermod.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/sawenv.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/sawenv.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/sawenvsvfenv.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/sawenvsvfenv.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/sawfilterednoise.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/sawfilterednoise.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/sawfilteredsaw.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/sawfilteredsaw.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/sawtooth.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/sawtooth.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/splitexec.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/splitexec.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/square.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/square.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/square_lfo.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/square_lfo.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/submixer2x2.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/submixer2x2.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/submixer4x2.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/submixer4x2.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/submixer8x2.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/submixer8x2.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/subtract.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/subtract.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/svfilter.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/svfilter.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/tail.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/tail.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/tapoutput.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/tapoutput.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/timesplus.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/timesplus.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/triangle.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/triangle.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/triangle_lfo.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/triangle_lfo.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/varmono16.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/varmono16.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/varmono8.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/varmono8.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Audio/dsp/varmono8_s.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Audio/dsp/varmono8_s.dsp
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Daemons/junk:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Devices/FMV/CL45016Bit.UCode:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Devices/FMV/CL45016Bit.UCode
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Devices/FMV/CL45024Bit.UCode:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Devices/FMV/CL45024Bit.UCode
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Devices/FMV/CL450Boot.UCode:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Devices/FMV/CL450Boot.UCode
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Devices/FMVVIDEODEVICE.PRIVDEVICE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Devices/FMVVIDEODEVICE.PRIVDEVICE
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Devices/ns.privdevice:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Devices/ns.privdevice
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/cport1.rom:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/cport1.rom
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/cport41.rom:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/cport41.rom
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/cport49.rom:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/cport49.rom
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/cport4d.rom:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/cport4d.rom
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/languages/da.language:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/languages/da.language
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/languages/de.language:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/languages/de.language
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/languages/es.language:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/languages/es.language
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/languages/fr.language:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/languages/fr.language
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/languages/it.language:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/languages/it.language
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/languages/ja.language:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/languages/ja.language
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/languages/nl.language:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/languages/nl.language
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/languages/pt.language:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/languages/pt.language
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Drivers/tuners/access.tuner:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Drivers/tuners/access.tuner
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Folios/audio.privfolio:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Folios/audio.privfolio
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Folios/compression.folio:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Folios/compression.folio
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Folios/debugger.privfolio:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Folios/debugger.privfolio
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Folios/graphics.privfolio:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Folios/graphics.privfolio
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Folios/international.privfolio:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Folios/international.privfolio
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Folios/international/CountryDatabase:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Folios/international/CountryDatabase
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Folios/jstring.folio:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Folios/jstring.folio
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Folios/operamath.privfolio:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Folios/operamath.privfolio
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Graphics/Fonts/Kanji16.4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Graphics/Fonts/Kanji16.4
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Kernel/boot_code:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Kernel/boot_code
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Kernel/misc_code:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Kernel/misc_code
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Kernel/os_code:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Kernel/os_code
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/copy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/copy
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/delete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/delete
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/dismount:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/dismount
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/eeprom:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/eeprom
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/format:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/format
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/fscheck:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/fscheck
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/gdbug:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/gdbug
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/lmadm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/lmadm
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/lmdump:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/lmdump
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/ls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/ls
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/mount:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/mount
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/sysload:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/sysload
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/type:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/type
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/walker:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/walker
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Programs/what:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Programs/what
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Scripts/startopera:
--------------------------------------------------------------------------------
1 | # Copyright (C) 1995, an unpublished work by The 3DO Company. All rights reserved.
# This material contains confidential information that is the property of The 3DO Company.
# Any unauthorized duplication, disclosure or use is prohibited.
# $Id: startopera,v 1.27 1994/08/06 00:20:23 peabody Exp $
killkprintf
alias aiff $audio/aiff
alias dsp $audio/dsp
alias languages $drivers/Languages
alias tuners $drivers/Tuners
alias programs $boot/System/Programs
alias fonts {/rom2/System/Graphics/Fonts|$boot/System/Graphics/Fonts}
alias c $programs
alias s $scripts
alias app $boot
fg
$c/fscheck
bg
$tasks/eventbroker@
#minmem
$boot/AppStartup%
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Tasks/eventbroker:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Tasks/eventbroker
--------------------------------------------------------------------------------
/src/platform/3do/CD/System/Tasks/shell:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/System/Tasks/shell
--------------------------------------------------------------------------------
/src/platform/3do/CD/rom_tags:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/CD/rom_tags
--------------------------------------------------------------------------------
/src/platform/3do/banner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3do/banner.bmp
--------------------------------------------------------------------------------
/src/platform/3do/boxRotateYQ.s:
--------------------------------------------------------------------------------
1 | AREA |C$$code|, CODE, READONLY
2 | |x$codeseg|
3 |
4 | INCLUDE common_asm.inc
5 |
6 | EXPORT boxRotateYQ_asm
7 |
8 | vx RN r0
9 | q RN r1
10 | vz RN r2
11 |
12 | min RN q
13 | max RN r3
14 |
15 | minX RN r12
16 | maxX RN lr
17 | minZ RN minX
18 | maxZ RN maxX
19 |
20 | boxRotateYQ_asm
21 | cmp q, #2
22 | moveq pc, lr
23 |
24 | stmfd sp!, {lr}
25 |
26 | add vz, vx, #(4 * 4)
27 |
28 | cmp q, #1
29 | beq q_1
30 | cmp q, #3
31 | beq q_3
32 |
33 | q_0 ldmia vx, {minX, maxX}
34 | rsb min, maxX, #0
35 | rsb max, minX, #0
36 | stmia vx, {min, max}
37 | ldmia vz, {minZ, maxZ}
38 | rsb min, maxZ, #0
39 | rsb max, minZ, #0
40 | stmia vz, {min, max}
41 | ldmfd sp!, {pc}
42 |
43 | q_1 ldmia vz, {minZ, maxZ}
44 | ldmia vx, {min, max}
45 | stmia vz, {min, max}
46 | rsb min, maxZ, #0
47 | rsb max, minZ, #0
48 | stmia vx, {min, max}
49 | ldmfd sp!, {pc}
50 |
51 | q_3 ldmia vx, {minX, maxX}
52 | ldmia vz, {min, max}
53 | stmia vx, {min, max}
54 | rsb min, maxX, #0
55 | rsb max, minX, #0
56 | stmia vz, {min, max}
57 | ldmfd sp!, {pc}
58 | END
59 |
--------------------------------------------------------------------------------
/src/platform/3do/boxTranslate.s:
--------------------------------------------------------------------------------
1 | AREA |C$$code|, CODE, READONLY
2 | |x$codeseg|
3 |
4 | INCLUDE common_asm.inc
5 |
6 | EXPORT boxTranslate_asm
7 |
8 | aabb RN r0
9 | x RN r1
10 | y RN r2
11 | z RN r3
12 | minX RN r4
13 | maxX RN r5
14 | minY RN r6
15 | maxY RN r7
16 | minZ RN r12
17 | maxZ RN lr
18 |
19 | boxTranslate_asm
20 | stmfd sp!, {r4-r7, lr}
21 |
22 | ldmia aabb, {minX, maxX, minY, maxY, minZ, maxZ}
23 | add minX, minX, x
24 | add maxX, maxX, x
25 | add minY, minY, y
26 | add maxY, maxY, y
27 | add minZ, minZ, z
28 | add maxZ, maxZ, z
29 | stmia aabb, {minX, maxX, minY, maxY, minZ, maxZ}
30 |
31 | ldmfd sp!, {r4-r7, pc}
32 | END
33 |
--------------------------------------------------------------------------------
/src/platform/3do/matrixPush.s:
--------------------------------------------------------------------------------
1 | AREA |C$$code|, CODE, READONLY
2 | |x$codeseg|
3 |
4 | INCLUDE common_asm.inc
5 |
6 | EXPORT matrixPush_asm
7 |
8 | e0 RN r0
9 | e1 RN r1
10 | e2 RN r2
11 | e3 RN r3
12 | m RN e0
13 | src RN r12
14 | dst RN lr
15 |
16 | matrixPush_asm
17 | stmfd sp!, {lr}
18 | ldr m, =gMatrixPtr
19 | ldr src, [m]
20 | add dst, src, #(12 * 4)
21 | str dst, [m]
22 |
23 | ldmia src!, {e0, e1, e2, e3}
24 | stmia dst!, {e0, e1, e2, e3}
25 |
26 | ldmia src!, {e0, e1, e2, e3}
27 | stmia dst!, {e0, e1, e2, e3}
28 |
29 | ldmia src!, {e0, e1, e2, e3}
30 | stmia dst!, {e0, e1, e2, e3}
31 |
32 | ldmfd sp!, {pc}
33 | END
34 |
--------------------------------------------------------------------------------
/src/platform/3do/matrixSetBasis.s:
--------------------------------------------------------------------------------
1 | AREA |C$$code|, CODE, READONLY
2 | |x$codeseg|
3 |
4 | INCLUDE common_asm.inc
5 |
6 | EXPORT matrixSetBasis_asm
7 |
8 | dst RN r0
9 | src RN r1
10 |
11 | e0 RN r2
12 | e1 RN r3
13 | e2 RN r12
14 |
15 | matrixSetBasis_asm
16 | ; column-major
17 | ; e0 e1 e2
18 | ; e0 e1 e2
19 | ; e0 e1 e2
20 | ; x y z
21 |
22 | ldmia src!, {e0, e1, e2}
23 | stmia dst!, {e0, e1, e2}
24 |
25 | ldmia src!, {e0, e1, e2}
26 | stmia dst!, {e0, e1, e2}
27 |
28 | ldmia src!, {e0, e1, e2}
29 | stmia dst!, {e0, e1, e2}
30 |
31 | mov pc, lr
32 | END
33 |
--------------------------------------------------------------------------------
/src/platform/3do/matrixSetIdentity.s:
--------------------------------------------------------------------------------
1 | AREA |C$$code|, CODE, READONLY
2 | |x$codeseg|
3 |
4 | INCLUDE common_asm.inc
5 |
6 | EXPORT matrixSetIdentity_asm
7 |
8 | e0 RN r0
9 | e1 RN r1
10 | e2 RN r2
11 | e3 RN r3
12 | m RN r12
13 |
14 | matrixSetIdentity_asm
15 | ldr m, =gMatrixPtr
16 | ldr m, [m]
17 | mov e0, #0x4000
18 | mov e1, #0
19 | mov e2, #0
20 | mov e3, #0
21 |
22 | ; column-major
23 | ; e0 e1 e2
24 | ; e3 e0 e1
25 | ; e2 e3 e0
26 | ; e1 e2 e3
27 |
28 | stmia m!, {e0, e1, e2, e3}
29 | stmia m!, {e0, e1, e2, e3}
30 | stmia m!, {e0, e1, e2, e3}
31 |
32 | mov pc, lr
33 | END
34 |
--------------------------------------------------------------------------------
/src/platform/3do/sphereIsVisible.s:
--------------------------------------------------------------------------------
1 | AREA |C$$code|, CODE, READONLY
2 | |x$codeseg|
3 |
4 | INCLUDE common_asm.inc
5 |
6 | EXPORT sphereIsVisible_asm
7 |
8 | x RN r0
9 | y RN r1
10 | z RN r2
11 | r RN r3
12 | vx RN r4
13 | vy RN r5
14 | vz RN r6
15 | mx RN r7
16 | my RN r8
17 | mz RN r12
18 |
19 | m RN lr
20 | divLUT RN m
21 | vp RN m
22 | vMinXY RN z
23 | vMaxXY RN r
24 |
25 | rMinX RN vx
26 | rMaxX RN x
27 | rMinY RN vy
28 | rMaxY RN y
29 |
30 | sphereIsVisible_asm
31 | stmfd sp!, {r4-r8, lr}
32 |
33 | ldr m, =gMatrixPtr
34 | ldr m, [m]
35 |
36 | ldmia m!, {mx, my, mz}
37 | mul vx, mx, x
38 | mul vy, my, x
39 | mul vz, mz, x
40 | ldmia m!, {mx, my, mz}
41 | mla vx, mx, y, vx
42 | mla vy, my, y, vy
43 | mla vz, mz, y, vz
44 | ldmia m!, {mx, my, mz}
45 | mla vx, mx, z, vx
46 | mla vy, my, z, vy
47 | mla vz, mz, z, vz
48 |
49 | cmp vz, #VIEW_MAX_F
50 | bhi _fail
51 |
52 | mov x, vx, asr #FIXED_SHIFT
53 | mov y, vy, asr #FIXED_SHIFT
54 | mov z, vz, lsr #(FIXED_SHIFT + PROJ_SHIFT)
55 |
56 | ldr divLUT, =divTable
57 | ldr z, [divLUT, z, lsl #2]
58 | mul x, z, x
59 | mul y, z, y
60 | mul r, z, r
61 |
62 | mov x, x, asr #(16 - PROJ_SHIFT)
63 | mov y, y, lsl #(PROJ_SHIFT)
64 |
65 | sub rMinX, x, r, lsr #(16 - PROJ_SHIFT)
66 | add rMaxX, x, r, lsr #(16 - PROJ_SHIFT)
67 | sub rMinY, y, r, lsl #PROJ_SHIFT
68 | add rMaxY, y, r, lsl #PROJ_SHIFT
69 |
70 | ldr vp, =viewportRel
71 | ldmia vp, {vMinXY, vMaxXY}
72 |
73 | cmp rMaxX, vMinXY, asr #16
74 | blt _fail
75 | cmp rMaxY, vMinXY, lsl #16
76 | blt _fail
77 | cmp rMinX, vMaxXY, asr #16
78 | bgt _fail
79 | cmp rMinY, vMaxXY, lsl #16
80 | bgt _fail
81 |
82 | mov r0, #1
83 | ldmfd sp!, {r4-r8, pc}
84 |
85 | _fail mov r0, #0
86 | ldmfd sp!, {r4-r8, pc}
87 | END
88 |
--------------------------------------------------------------------------------
/src/platform/3do/unpackMesh.s:
--------------------------------------------------------------------------------
1 | AREA |C$$code|, CODE, READONLY
2 | |x$codeseg|
3 |
4 | INCLUDE common_asm.inc
5 |
6 | EXPORT unpackMesh_asm
7 |
8 | unpackMesh_asm
9 |
10 | data RN r0
11 | vCount RN r1
12 | vx0 RN vCount
13 | vy0 RN r2
14 | vz0 RN r3
15 | vx1 RN r4
16 | vy1 RN r5
17 | vz1 RN r6
18 | n0 RN vy0
19 | n1 RN vx1
20 | n2 RN vz1
21 | vertex RN r12
22 | last RN lr
23 |
24 | stmfd sp!, {r4-r6, lr}
25 | ldr vertex, =gVertices
26 | add vCount, vCount, vCount, lsl #1
27 | add last, data, vCount, lsl #1 ; last = data + vCount * 6
28 |
29 | loop ldmia data!, {n0, n1, n2} ; load two encoded vertices
30 | cmp data, last
31 |
32 | mov vx0, n0, asr #16 ; x
33 | mov n0, n0, lsl #16
34 | mov vy0, n0, asr #16 ; y
35 |
36 | mov vz0, n1, asr #16 ; z
37 | mov n1, n1, lsl #16
38 | mov vx1, n1, asr #16 ; x
39 |
40 | mov vy1, n2, asr #16 ; y
41 | mov n2, n2, lsl #16
42 | mov vz1, n2, asr #16 ; z
43 |
44 | stmia vertex!, {vx0, vy0, vz0, vx1, vy1, vz1}
45 | blt loop
46 |
47 | ldmfd sp!, {r4-r6, pc}
48 | END
49 |
--------------------------------------------------------------------------------
/src/platform/3do/unpackRoom.s:
--------------------------------------------------------------------------------
1 | AREA |C$$code|, CODE, READONLY
2 | |x$codeseg|
3 |
4 | INCLUDE common_asm.inc
5 |
6 | EXPORT unpackRoom_asm
7 |
8 | unpackRoom_asm
9 |
10 | data RN r0
11 | vCount RN r1
12 | vx0 RN vCount
13 | vy0 RN r2
14 | vz0 RN r3
15 | vx1 RN r4
16 | vy1 RN r5
17 | vz1 RN r6
18 | vx2 RN vx0
19 | vy2 RN vy0
20 | vz2 RN vz0
21 | vx3 RN vx1
22 | vy3 RN vy1
23 | vz3 RN vz1
24 | n0 RN vz1
25 | n1 RN r7
26 | maskH RN r8
27 | maskV RN r9
28 | vertex RN r12
29 | last RN lr
30 |
31 | stmfd sp!, {r4-r9, lr}
32 | ldr vertex, =gVertices
33 | add last, data, vCount, lsl #1 ; last = data + vCount * 2
34 | mov maskH, #0x1F000
35 | mov maskV, #0x0FC00
36 |
37 | loop ldmia data!, {n0, n1} ; load four encoded vertices
38 | cmp data, last
39 |
40 | ; n0 = z1:5, y1:6, x1:5, z0:5, y0:6, x0:5
41 | ; n1 = z3:5, y3:6, x3:5, z2:5, y2:6, x2:5
42 |
43 | ; 1st vertex
44 | and vx0, maskH, n0, lsl #12 ; decode x0
45 | and vy0, maskV, n0, lsl #5 ; decode y0
46 | and vz0, maskH, n0, lsl #1 ; decode z0
47 |
48 | ; 2nd vertex
49 | and vx1, maskH, n0, lsr #4 ; decode x1
50 | and vy1, maskV, n0, lsr #11 ; decode y1
51 | and vz1, maskH, n0, lsr #15 ; decode z1
52 |
53 | ; store
54 | stmia vertex!, {vx0, vy0, vz0, vx1, vy1, vz1}
55 |
56 | ; 3rd vertex
57 | and vx2, maskH, n1, lsl #12 ; decode x2
58 | and vy2, maskV, n1, lsl #5 ; decode y2
59 | and vz2, maskH, n1, lsl #1 ; decode z2
60 |
61 | ; 4th vertex
62 | and vx3, maskH, n1, lsr #4 ; decode x3
63 | and vy3, maskV, n1, lsr #11 ; decode y3
64 | and vz3, maskH, n1, lsr #15 ; decode z3
65 |
66 | ; store
67 | stmia vertex!, {vx2, vy2, vz2, vx3, vy3, vz3}
68 |
69 | blt loop
70 |
71 | ldmfd sp!, {r4-r9, pc}
72 | END
73 |
--------------------------------------------------------------------------------
/src/platform/3ds/deploy.sh:
--------------------------------------------------------------------------------
1 | make
2 | /C/devkitPro/tools/bin/3dslink.exe OpenLara.3dsx -a 192.168.1.68
3 |
--------------------------------------------------------------------------------
/src/platform/3ds/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/3ds/icon.png
--------------------------------------------------------------------------------
/src/platform/android/app/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.4.1)
2 |
3 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
4 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DANDROID -std=c++11 -fno-rtti -fno-exceptions -fvisibility=hidden -Wall -Wno-invalid-source-encoding")
5 |
6 | add_library( game SHARED
7 | src/main/cpp/main.cpp
8 | ../../../libs/stb_vorbis/stb_vorbis.c
9 | ../../../libs/minimp3/minimp3.cpp
10 | ../../../libs/tinf/tinflate.c
11 | )
12 |
13 | include_directories(../../../)
14 |
15 | target_link_libraries( game GLESv3 OpenSLES log )
--------------------------------------------------------------------------------
/src/platform/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 30
5 | buildToolsVersion '30.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xproger.openlara"
9 | minSdkVersion 19
10 | targetSdkVersion 30
11 | versionCode 1
12 | versionName "0.1"
13 | ndk {
14 | abiFilters 'armeabi-v7a', 'x86', 'x86_64'
15 | }
16 | externalNativeBuild {
17 | cmake {
18 | arguments '-DANDROID_TOOLCHAIN=clang'
19 | }
20 | }
21 | }
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 | externalNativeBuild {
29 | cmake {
30 | path "CMakeLists.txt"
31 | }
32 | }
33 | aaptOptions {
34 | noCompress 'psx', 'phd', 'pcx', 'mp3', 'ogg'
35 | }
36 | }
37 |
38 | dependencies {
39 | compile fileTree(include: ['*.jar'], dir: 'libs')
40 |
41 | compile 'com.google.vr:sdk-base:1.80.0'
42 | }
43 |
--------------------------------------------------------------------------------
/src/platform/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\XProger\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/src/platform/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/platform/android/app/src/main/res/drawable/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/android/app/src/main/res/drawable/banner.png
--------------------------------------------------------------------------------
/src/platform/android/app/src/main/res/drawable/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/android/app/src/main/res/drawable/ic_launcher.png
--------------------------------------------------------------------------------
/src/platform/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | OpenLara
3 |
4 |
--------------------------------------------------------------------------------
/src/platform/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.0.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/src/platform/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/src/platform/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/src/platform/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Mar 20 22:10:10 MSK 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/src/platform/android/native_wip/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/platform/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/src/platform/bittboy/build.sh:
--------------------------------------------------------------------------------
1 | /opt/bittboy-toolchain/bin/arm-buildroot-linux-musleabi-g++ -std=c++11 -O3 -s -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -D__BITTBOY__ -DNDEBUG -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o../../../bin/OpenLara -lm -lpthread -lSDL -lasound
2 |
--------------------------------------------------------------------------------
/src/platform/bittboy/build_miyoo.sh:
--------------------------------------------------------------------------------
1 | /opt/miyoo-toolchain/bin/arm-miyoo-linux-uclibcgnueabi-g++ -std=c++11 -O3 -s -fno-unroll-loops -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -D__MIYOO__ -DNDEBUG -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o../../../bin/OpenLara -lm -lpthread -lSDL -lasound
2 |
--------------------------------------------------------------------------------
/src/platform/clover/build.sh:
--------------------------------------------------------------------------------
1 | set -e
2 | clang++ -std=c++11 -Os -s -g -marm -march=armv7ve -mtune=cortex-a7 -mfloat-abi=hard -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding -DNDEBUG -D__CLOVER__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -L/opt/vc/lib/ -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev -o../../../bin/OpenLara
3 | strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note
4 |
--------------------------------------------------------------------------------
/src/platform/dos/DOS4GW.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/dos/DOS4GW.exe
--------------------------------------------------------------------------------
/src/platform/dos/deploy.bat:
--------------------------------------------------------------------------------
1 | rm *.obj *.err
2 | copy ..\gba\render.iwram.cpp render.cpp /Y
3 | wcl386.exe *.cpp ..\..\fixed\*.cpp -fe=OpenLara.exe -i="C:\WATCOM/h" -i="..\..\fixed" -wcd726 -w4 -e25 -zq -ox -d2 -6r -bt=dos -fo=.obj -zmf -xd -l=pmodew
4 | C:\Dosbox\dosbox -conf dosbox.conf OpenLara.exe
--------------------------------------------------------------------------------
/src/platform/dos/dosbox.conf:
--------------------------------------------------------------------------------
1 | [autoexec]
2 | @echo off
3 | mount c: C:\Projects\OpenLara\src\platform\dos
4 | c:
5 |
6 | [cpu]
7 | cycles=fixed 26800
8 |
9 | [serial]
10 | serial1=directserial realport:COM3
--------------------------------------------------------------------------------
/src/platform/dos/sound.cpp:
--------------------------------------------------------------------------------
1 | #include "common.h"
2 |
3 | void sndInit()
4 | {
5 | // TODO
6 | }
7 |
8 | void sndInitSamples()
9 | {
10 | // TODO
11 | }
12 |
13 | void sndFreeSamples()
14 | {
15 | // TODO
16 | }
17 |
18 | void* sndPlaySample(int32 index, int32 volume, int32 pitch, int32 mode)
19 | {
20 | return NULL; // TODO
21 | }
22 |
23 | void sndPlayTrack(int32 track)
24 | {
25 | // TODO
26 | }
27 |
28 | void sndStopTrack()
29 | {
30 | // TODO
31 | }
32 |
33 | bool sndTrackIsPlaying()
34 | {
35 | return false; // TODO
36 | }
37 |
38 | void sndStopSample(int32 index)
39 | {
40 | // TODO
41 | }
42 |
43 | void sndStop()
44 | {
45 | // TODO
46 | }
47 |
48 | void sndFill(uint8* buffer, int32 count)
49 | {
50 | // TODO
51 | }
52 |
--------------------------------------------------------------------------------
/src/platform/gba/IMGS/O/P/OPLA.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/IMGS/O/P/OPLA.bmp
--------------------------------------------------------------------------------
/src/platform/gba/OpenLara.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.1022
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenLara", "OpenLara.vcxproj", "{990C6F40-6226-4011-B52C-FF042EBB7F15}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {990C6F40-6226-4011-B52C-FF042EBB7F15}.Debug|x64.ActiveCfg = Debug|x64
17 | {990C6F40-6226-4011-B52C-FF042EBB7F15}.Debug|x64.Build.0 = Debug|x64
18 | {990C6F40-6226-4011-B52C-FF042EBB7F15}.Debug|x86.ActiveCfg = Debug|Win32
19 | {990C6F40-6226-4011-B52C-FF042EBB7F15}.Debug|x86.Build.0 = Debug|Win32
20 | {990C6F40-6226-4011-B52C-FF042EBB7F15}.Release|x64.ActiveCfg = Release|x64
21 | {990C6F40-6226-4011-B52C-FF042EBB7F15}.Release|x64.Build.0 = Release|x64
22 | {990C6F40-6226-4011-B52C-FF042EBB7F15}.Release|x86.ActiveCfg = Release|Win32
23 | {990C6F40-6226-4011-B52C-FF042EBB7F15}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {8D133CA9-7AA0-4806-9B61-82E8A3044A15}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/boxRotateYQ.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | v .req r0 // arg
4 | q .req r1 // arg
5 |
6 | min .req q
7 | max .req r2
8 |
9 | minX .req r3
10 | maxX .req r12
11 | minZ .req minX
12 | maxZ .req maxX
13 |
14 | .global boxRotateYQ_asm
15 | boxRotateYQ_asm:
16 | cmp q, #2
17 | bxeq lr
18 |
19 | cmp q, #1
20 | beq .q_1
21 | cmp q, #3
22 | beq .q_3
23 |
24 | .q_0:
25 | ldmia v, {minX, maxX}
26 | rsb min, maxX, #0
27 | rsb max, minX, #0
28 | stmia v, {min, max}
29 | add v, #16
30 | ldmia v, {minZ, maxZ}
31 | rsb min, maxZ, #0
32 | rsb max, minZ, #0
33 | stmia v, {min, max}
34 | bx lr
35 |
36 | .q_1:
37 | ldmia v, {min, max}
38 | add v, #16
39 | ldmia v, {minZ, maxZ}
40 | stmia v, {min, max}
41 | rsb min, maxZ, #0
42 | rsb max, minZ, #0
43 | sub v, #16
44 | stmia v, {min, max}
45 | bx lr
46 |
47 | .q_3:
48 | add v, #16
49 | ldmia v, {min, max}
50 | sub v, #16
51 | ldmia v, {minX, maxX}
52 | stmia v, {min, max}
53 | rsb min, maxX, #0
54 | rsb max, minX, #0
55 | add v, #16
56 | stmia v, {min, max}
57 | bx lr
58 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/boxTranslate.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | aabb .req r0 // arg
4 | x .req r1 // arg
5 | y .req r2 // arg
6 | z .req r3 // arg
7 | // FIQ regs
8 | minX .req r8
9 | maxX .req r9
10 | minY .req r10
11 | maxY .req r11
12 | minZ .req r12
13 | maxZ .req r13
14 |
15 | .global boxTranslate_asm
16 | boxTranslate_asm:
17 | fiq_on
18 |
19 | ldmia aabb, {minX, maxX, minY, maxY, minZ, maxZ}
20 | add minX, minX, x
21 | add maxX, maxX, x
22 | add minY, minY, y
23 | add maxY, maxY, y
24 | add minZ, minZ, z
25 | add maxZ, maxZ, z
26 | stmia aabb, {minX, maxX, minY, maxY, minZ, maxZ}
27 |
28 | fiq_off
29 | bx lr
30 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/clearFB.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | dst .req r0 // arg
4 | end .req r14
5 |
6 | .global clearFB_asm
7 | clearFB_asm:
8 | stmfd sp!, {r4-r6}
9 | fiq_on
10 |
11 | // 12 words
12 | mov r1, #0
13 | mov r2, #0
14 | mov r3, #0
15 | mov r4, #0
16 | mov r5, #0
17 | mov r6, #0
18 | // FIQ regs
19 | mov r8, #0
20 | mov r9, #0
21 | mov r10, #0
22 | mov r11, #0
23 | mov r12, #0
24 | mov r13, #0
25 | add end, dst, #(FRAME_WIDTH * FRAME_HEIGHT)
26 |
27 | .loop:
28 | // fill 12 * 4 * 8 bytes per iteration
29 | stmia dst!, {r1-r6, r8-r13}
30 | stmia dst!, {r1-r6, r8-r13}
31 | stmia dst!, {r1-r6, r8-r13}
32 | stmia dst!, {r1-r6, r8-r13}
33 | stmia dst!, {r1-r6, r8-r13}
34 | stmia dst!, {r1-r6, r8-r13}
35 | stmia dst!, {r1-r6, r8-r13}
36 | stmia dst!, {r1-r6, r8-r13}
37 |
38 | cmp dst, end
39 | blt .loop
40 |
41 | fiq_off
42 | ldmfd sp!, {r4-r6}
43 | bx lr
44 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/getSector.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | this .req r0 // arg
4 | x .req r1 // arg
5 | z .req r2 // arg
6 | info .req r3
7 | roomX .req r12
8 | roomZ .req roomX
9 | sx .req x
10 | sz .req z
11 | sectors .req this
12 | sectorsX .req roomX
13 | sectorsZ .req roomZ
14 | offset .req sectorsZ
15 |
16 | // const Sector* Room::getSector(int32 x, int32 z) const
17 | .global _ZNK4Room9getSectorEii
18 | _ZNK4Room9getSectorEii:
19 | ldr info, [this, #4]
20 |
21 | // sx = X_CLAMP((x - (info->x << 8)) >> 10, 0, info->xSectors - 1);
22 | ldrsh roomX, [info]
23 | subs sx, x, roomX, lsl #8
24 | movlt sx, #0
25 | mov sx, sx, lsr #10
26 | ldrb sectorsX, [info, #20]
27 | cmp sx, sectorsX
28 | subge sx, sectorsX, #1
29 |
30 | // sz = X_CLAMP((z - (info->z << 8)) >> 10, 0, info->zSectors - 1);
31 | ldrsh roomZ, [info, #2]
32 | subs sz, z, roomZ, lsl #8
33 | movlt sz, #0
34 | mov sz, sz, lsr #10
35 | ldrb sectorsZ, [info, #21]
36 | cmp sz, sectorsZ
37 | subge sz, sectorsZ, #1
38 |
39 | // return sectors + sx * info->zSectors + sz;
40 | ldr sectors, [this, #8]
41 | mla offset, sx, sectorsZ, sz
42 | add sectors, offset, lsl #3 // sizeof(Sector) == (1 << 3)
43 |
44 | bx lr
45 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/matrixFrame.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | pos .req r0 // arg
4 | angles .req r1 // arg
5 | x .req pos
6 | y .req angles
7 | z .req r2
8 | mask .req r3
9 | packed .req r12
10 |
11 | .extern matrixTranslateRel_asm, matrixRotateYXZ_fast_asm
12 |
13 | .global matrixFrame_asm
14 | matrixFrame_asm:
15 | stmfd sp!, {lr}
16 |
17 | ldr packed, [angles]
18 | ldrsh z, [pos, #4]
19 | ldrsh y, [pos, #2]
20 | ldrsh x, [pos, #0]
21 |
22 | bl matrixTranslateRel_asm // doesn't affect user mode r12
23 |
24 | mov mask, #4096
25 | sub mask, #4
26 |
27 | and z, mask, packed, lsl #2
28 | and y, mask, packed, lsr #(10 - 2)
29 | and x, mask, packed, lsr #(20 - 2)
30 |
31 | ldmfd sp!, {lr}
32 | b matrixRotateYXZ_fast_asm
33 |
34 | // TODO matrixFrameLerp
--------------------------------------------------------------------------------
/src/platform/gba/asm/matrixPush.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | e0 .req r0
4 | e1 .req r1
5 | e2 .req r2
6 | e3 .req r3
7 | m .req e0
8 | // FIQ regs
9 | src .req r8
10 | dst .req r9
11 | e4 .req r10
12 | e5 .req r11
13 |
14 | .global matrixPush_asm
15 | matrixPush_asm:
16 | fiq_on
17 |
18 | ldr m, =gMatrixPtr
19 | ldr src, [m]
20 | add dst, src, #(12 * 4)
21 | str dst, [m]
22 |
23 | ldmia src!, {e0, e1, e2, e3, e4, e5}
24 | stmia dst!, {e0, e1, e2, e3, e4, e5}
25 |
26 | ldmia src!, {e0, e1, e2, e3, e4, e5}
27 | stmia dst!, {e0, e1, e2, e3, e4, e5}
28 |
29 | fiq_off
30 | bx lr
31 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/matrixSetBasis.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | dst .req r0 // arg
4 | src .req r1 // arg
5 |
6 | e0 .req r2
7 | e1 .req r3
8 | e2 .req r12
9 |
10 | .global matrixSetBasis_asm
11 | matrixSetBasis_asm:
12 | // row-major
13 | // e0 e1 e2 x
14 | // e0 e1 e2 y
15 | // e0 e1 e2 z
16 |
17 | ldmia src, {e0, e1, e2}
18 | stmia dst, {e0, e1, e2}
19 | add src, #(4 * 4)
20 | add dst, #(4 * 4)
21 |
22 | ldmia src, {e0, e1, e2}
23 | stmia dst, {e0, e1, e2}
24 | add src, #(4 * 4)
25 | add dst, #(4 * 4)
26 |
27 | ldmia src, {e0, e1, e2}
28 | stmia dst, {e0, e1, e2}
29 | add src, #(4 * 4)
30 | add dst, #(4 * 4)
31 |
32 | bx lr
33 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/matrixSetIdentity.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | e0 .req r0
4 | e1 .req r1
5 | e2 .req r2
6 | e3 .req r3
7 | // FIQ regs
8 | e4 .req r8
9 | e5 .req r9
10 | e6 .req r10
11 | m .req r11
12 |
13 | .global matrixSetIdentity_asm
14 | matrixSetIdentity_asm:
15 | fiq_on
16 | ldr m, =gMatrixPtr
17 | ldr m, [m]
18 | mov e0, #0x4000
19 | mov e1, #0
20 | mov e2, #0
21 | mov e3, #0
22 | mov e4, #0
23 | mov e5, #0x4000
24 | mov e6, #0
25 |
26 | // row-major
27 | // e0 e1 e2 e3
28 | // e4 e5 e6 e2
29 | // e3 e4 e5 e6
30 |
31 | stmia m!, {e0, e1, e2, e3, e4, e5, e6}
32 | stmia m!, {e2, e3, e4, e5, e6}
33 |
34 | fiq_off
35 | bx lr
36 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/rasterize.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | flags .req r0 // arg
4 | L .req r1 // arg
5 | R .req r2
6 | y .req r3
7 | type .req r12
8 | pixel .req flags
9 |
10 | .extern rasterizeS_asm
11 | .extern rasterizeF_asm
12 | .extern rasterizeFT_asm
13 | .extern rasterizeFTA_asm
14 | .extern rasterizeGT_asm
15 | .extern rasterizeGTA_asm
16 | .extern rasterizeSprite_c
17 | .extern rasterizeFillS_asm
18 | .extern rasterizeLineH_asm
19 | .extern rasterizeLineV_asm
20 | .extern rasterize_dummy
21 |
22 | .global rasterize_asm
23 | rasterize_asm:
24 | and type, flags, #FACE_TYPE_MASK
25 |
26 | cmp type, #FACE_TYPE_F
27 | andeq R, flags, #0xFF // R = face color for FACE_TYPE_F
28 | movne R, L // R = L otherwise
29 |
30 | ldr pixel, =fb
31 | ldr pixel, [pixel]
32 | ldrsh y, [L, #VERTEX_Y]
33 |
34 | // pixel += y * 240 -> (y * 16 - y) * 16
35 | rsb y, y, y, lsl #4
36 | add pixel, pixel, y, lsl #4
37 |
38 | add pc, type, lsr #(FACE_TYPE_SHIFT - 2)
39 | nop
40 | b rasterizeS_asm
41 | b rasterizeF_asm
42 | b rasterizeFT_asm
43 | b rasterizeFTA_asm
44 | b rasterizeGT_asm
45 | b rasterizeGTA_asm
46 | b rasterizeSprite_c
47 | b rasterizeFillS_asm
48 | b rasterizeLineH_asm
49 | b rasterizeLineV_asm
50 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/rasterizeFillS.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | pixel .req r0 // arg
4 | L .req r1 // arg
5 | R .req r2 // arg
6 | p .req r3
7 | // FIQ regs
8 | w .req r8
9 | indexA .req r9
10 | indexB .req r10
11 | shade .req r11
12 |
13 | width .req L
14 | height .req R
15 | LMAP .req shade
16 |
17 | .global rasterizeFillS_asm
18 | rasterizeFillS_asm:
19 | fiq_on
20 |
21 | add R, #VERTEX_SIZEOF
22 | ldrsh p, [L, #VERTEX_X]
23 | add pixel, p
24 | ldrb shade, [L, #VERTEX_G]
25 | ldrsh width, [R, #VERTEX_X]
26 | ldrsh height, [R, #VERTEX_Y]
27 | lsl shade, #8
28 | add LMAP, shade, #LMAP_ADDR
29 |
30 | .loop:
31 | mov p, pixel
32 | mov w, width
33 |
34 | // 2 bytes alignment (VRAM write requirement)
35 | .align_left:
36 | tst p, #1
37 | beq .align_right
38 | ldrh indexA, [p, #-1]!
39 | ldrb indexB, [LMAP, indexA, lsr #8]
40 | and indexA, indexA, #0xFF
41 | orr indexA, indexB, lsl #8
42 | strh indexA, [p], #2
43 | subs w, #1
44 | beq .scanline_end
45 |
46 | .align_right:
47 | tst w, #1
48 | beq .scanline_block_2px
49 | subs w, #1
50 | ldrh indexA, [p, w]
51 | and indexB, indexA, #0xFF
52 | ldrb indexB, [LMAP, indexB]
53 | and indexA, indexA, #0xFF00
54 | orr indexA, indexA, indexB
55 | strh indexA, [p, w]
56 | beq .scanline_end
57 |
58 | .scanline_block_2px:
59 | ldrh indexA, [p]
60 | and indexB, indexA, #0xFF
61 | ldrb indexA, [LMAP, indexA, lsr #8]
62 | ldrb indexB, [LMAP, indexB]
63 | orr indexA, indexB, indexA, lsl #8
64 | strh indexA, [p], #2
65 | subs w, #2
66 | bne .scanline_block_2px
67 |
68 | .scanline_end:
69 | add pixel, #FRAME_WIDTH
70 | subs height, #1
71 | bne .loop
72 |
73 | fiq_off
74 | bx lr
75 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/rasterizeLineH.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | pixel .req r0 // arg
4 | L .req r1 // arg
5 | R .req r2 // arg
6 | tmp .req r12
7 | index .req L
8 | width .req R
9 |
10 | .global rasterizeLineH_asm
11 | rasterizeLineH_asm:
12 | add R, #VERTEX_SIZEOF
13 | ldrsh tmp, [L, #VERTEX_X]
14 | add pixel, tmp
15 | ldrb index, [L, #VERTEX_G]
16 | ldrsh width, [R, #VERTEX_X]
17 |
18 | // 2 bytes alignment (VRAM write requirement)
19 | .align_left:
20 | tst pixel, #1
21 | beq .align_right
22 | ldrb tmp, [pixel, #-1]!
23 | orr tmp, index, lsl #8
24 | strh tmp, [pixel], #2
25 | subs width, #1
26 | beq .scanline_end
27 |
28 | .align_right:
29 | tst width, #1
30 | beq .scanline_block_2px
31 | ldrb tmp, [pixel, width]
32 | subs width, #1
33 | orr tmp, index, tmp, lsl #8
34 | strh tmp, [pixel, width]
35 | beq .scanline_end
36 |
37 | .scanline_block_2px:
38 | strb index, [pixel], #2 // VRAM one as two bytes write hack
39 | subs width, #2
40 | bne .scanline_block_2px
41 |
42 | .scanline_end:
43 | mov pc, lr
44 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/rasterizeLineV.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | pixel .req r0 // arg
4 | L .req r1 // arg
5 | R .req r2 // arg
6 | tmp .req r12
7 | index .req L
8 | height .req R
9 |
10 | .global rasterizeLineV_asm
11 | rasterizeLineV_asm:
12 | add R, #VERTEX_SIZEOF
13 | ldrsh tmp, [L, #VERTEX_X]
14 | ldrb index, [L, #VERTEX_G]
15 | ldrsh height, [R, #VERTEX_Y]
16 | add pixel, tmp
17 |
18 | tst pixel, #1
19 | beq .right
20 |
21 | sub pixel, #1
22 | .left:
23 | ldrb tmp, [pixel]
24 | orr tmp, index, lsl #8
25 | strh tmp, [pixel], #FRAME_WIDTH
26 | subs height, #1
27 | bne .left
28 | mov pc, lr
29 |
30 | .right:
31 | ldrb tmp, [pixel, #1]
32 | orr tmp, index, tmp, lsl #8
33 | strh tmp, [pixel], #FRAME_WIDTH
34 | subs height, #1
35 | bne .right
36 | mov pc, lr
37 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/rasterize_dummy.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | .global rasterize_dummy
4 | rasterize_dummy:
5 | bx lr
--------------------------------------------------------------------------------
/src/platform/gba/asm/sdiv32.s:
--------------------------------------------------------------------------------
1 | @--------------------------------------------------------------------------------
2 | @ udiv.s
3 | @--------------------------------------------------------------------------------
4 | @ Provides an implementation of signed division
5 | @--------------------------------------------------------------------------------
6 |
7 | @ refer to the unsigned division
8 | .extern __aeabi_uidivmod
9 | .extern __aeabi_uidiv
10 |
11 | @ r0: the numerator / r1: the denominator
12 | @ after it, r0 has the quotient and r1 has the modulo
13 | .section .iwram, "ax", %progbits
14 | .align 2
15 | .arm
16 | .global __aeabi_idivmod
17 | .type __aeabi_idivmod STT_FUNC
18 | __aeabi_idivmod:
19 |
20 | .section .iwram, "ax", %progbits
21 | .align 2
22 | .arm
23 | .global __aeabi_idiv
24 | .type __aeabi_idiv STT_FUNC
25 | __aeabi_idiv:
26 |
27 | @ Move the lr to r12 and make the numbers positive
28 | mov r12, lr
29 |
30 | cmp r0, #0
31 | rsblt r0, #0
32 | orrlt r12, #1 << 30
33 |
34 | cmp r1, #0
35 | rsblt r1, #0
36 | orrlt r12, #1 << 31
37 |
38 | @ Call the unsigned division
39 | .extern udiv32pastzero
40 | bl udiv32pastzero
41 |
42 | @ Test the old sign bits
43 | tst r12, #1 << 30
44 | rsbne r0, r0, #0
45 | rsbne r1, r0, #0
46 | tst r12, #1 << 31
47 | rsbne r0, r0, #0
48 |
49 | @ Erase the sign bits from the return address, and return
50 | bic r12, #3 << 30
51 | bx r12
52 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/sndAD4.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | // Clamping is only required if the encoder gives overflow warnings.
4 | // To improve on speed, the music volume has been reduced to avoid this.
5 | #define CLAMP_OUTPUT 0
6 |
7 | // Unrolling saves 3.75 cycles per sample, but uses a lot more RAM.
8 | #define UNROLL 0
9 |
10 | state .req r0
11 | buffer .req r1
12 | data .req r2
13 | size .req r3
14 | zM1 .req r4
15 | zM2 .req r5
16 | tap .req r6
17 | quant .req r7
18 | n .req r8
19 | mask .req r9
20 | adapt .req r10
21 | stepLUT .req r11
22 | temp .req r12
23 |
24 | .macro adpcm4_decode zM1, zM2
25 | sub tap, tap, tap, asr #3
26 | add tap, tap, \zM2
27 | mov temp, tap, asr #8
28 | #if CLAMP_OUTPUT
29 | teq temp, temp, lsl #32-8
30 | eormi temp, mask, temp, asr #31
31 | #endif
32 | strb temp, [buffer], #1
33 | mov n, n, ror #4
34 | mov temp, n, asr #32-4
35 | sub \zM2, \zM1, \zM2
36 | mla \zM2, quant, temp, \zM2
37 | // zM1 and zM2 now swapped
38 | ldrb temp, [stepLUT, temp]
39 | mla temp, quant, temp, mask
40 | mov quant, temp, lsr #7
41 | .endm
42 |
43 | .global sndADPCM4_fill_asm
44 | sndADPCM4_fill_asm:
45 | stmfd sp!, {r4-r11}
46 |
47 | ldmia state, {zM1,zM2,tap,quant}
48 | mov mask, #127
49 | ldr stepLUT, =ADPCM4_ADAPT+8
50 |
51 | .loop:
52 | ldr n, [data], #4
53 | #if UNROLL
54 | .rept 8/2
55 | #endif
56 | 1: adpcm4_decode zM1, zM2 // zM1 and zM2 get swapped...
57 | adpcm4_decode zM2, zM1 // ... and swapped back
58 | #if UNROLL
59 | .endr
60 | #else
61 | adds size, size, #1<<(32-3+1) // Count up the 8 samples
62 | bcc 1b
63 | #endif
64 | subs size, #8/2 // size is provided as number of bytes
65 | bne .loop
66 |
67 | stmia state, {zM1,zM2,tap,quant}
68 |
69 | ldmfd sp!, {r4-r11}
70 | bx lr
71 |
--------------------------------------------------------------------------------
/src/platform/gba/asm/sphereIsVisible.s:
--------------------------------------------------------------------------------
1 | #include "common_asm.inc"
2 |
3 | x .req r0 // arg
4 | y .req r1 // arg
5 | z .req r2 // arg
6 | r .req r3 // arg
7 | // FIQ regs
8 | mx .req r8
9 | my .req r9
10 | mz .req r10
11 | vx .req r11
12 | vy .req r12
13 | vz .req r13
14 | m .req r14
15 | tmp .req m
16 | vp .req m
17 | dz .req vz
18 | minXY .req z
19 | maxXY .req r
20 |
21 | minX .req vx
22 | maxX .req x
23 | minY .req vy
24 | maxY .req y
25 |
26 | .global sphereIsVisible_asm
27 | sphereIsVisible_asm:
28 | fiq_on
29 |
30 | ldr m, =gMatrixPtr
31 | ldr m, [m]
32 |
33 | ldmia m!, {mx, my, mz, vx}
34 | mla vx, mx, x, vx
35 | mla vx, my, y, vx
36 | mla vx, mz, z, vx
37 | ldmia m!, {mx, my, mz, vy}
38 | mla vy, mx, x, vy
39 | mla vy, my, y, vy
40 | mla vy, mz, z, vy
41 | ldmia m!, {mx, my, mz, vz}
42 | mla vz, mx, x, vz
43 | mla vz, my, y, vz
44 | mla vz, mz, z, vz
45 |
46 | cmp vz, #(VIEW_MAX << FIXED_SHIFT)
47 | bhi .fail
48 |
49 | mov x, vx, asr #FIXED_SHIFT
50 | mov y, vy, asr #FIXED_SHIFT
51 | mov z, vz, asr #(FIXED_SHIFT + OT_SHIFT)
52 |
53 | add dz, z, z, lsr #2
54 | divLUT tmp, dz
55 | mul x, tmp, x
56 | mul y, tmp, y
57 | mul r, tmp, r
58 |
59 | mov x, x, asr #(16 - PROJ_SHIFT)
60 | mov y, y, asr #(16 - PROJ_SHIFT)
61 |
62 | sub minX, x, r, lsr #(16 - PROJ_SHIFT)
63 | add maxX, x, r, lsr #(16 - PROJ_SHIFT)
64 | sub minY, y, r, lsr #(16 - PROJ_SHIFT)
65 | add maxY, y, r, lsr #(16 - PROJ_SHIFT)
66 |
67 | ldr vp, =viewportRel
68 | ldmia vp, {minXY, maxXY}
69 |
70 | cmp maxX, minXY, asr #16
71 | ble .fail
72 | cmp minX, maxXY, asr #16
73 | bge .fail
74 |
75 | lsl minXY, #16
76 | lsl maxXY, #16
77 |
78 | cmp maxY, minXY, asr #16
79 | ble .fail
80 | cmp minY, maxXY, asr #16
81 | bge .fail
82 |
83 | mov r0, #1
84 | fiq_off
85 | bx lr
86 |
87 | .fail:
88 | mov r0, #0
89 | fiq_off
90 | bx lr
91 |
--------------------------------------------------------------------------------
/src/platform/gba/checkROM.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #define MEM_CHECK_MAGIC 14021968
4 | #define MEM_CHECK_SIZE 16
5 |
6 | const int ROM_MAGIC[MEM_CHECK_SIZE] = {
7 | MEM_CHECK_MAGIC + 0,
8 | MEM_CHECK_MAGIC + 1,
9 | MEM_CHECK_MAGIC + 2,
10 | MEM_CHECK_MAGIC + 3,
11 | MEM_CHECK_MAGIC + 4,
12 | MEM_CHECK_MAGIC + 5,
13 | MEM_CHECK_MAGIC + 6,
14 | MEM_CHECK_MAGIC + 7,
15 | MEM_CHECK_MAGIC + 8,
16 | MEM_CHECK_MAGIC + 9,
17 | MEM_CHECK_MAGIC + 10,
18 | MEM_CHECK_MAGIC + 11,
19 | MEM_CHECK_MAGIC + 12,
20 | MEM_CHECK_MAGIC + 13,
21 | MEM_CHECK_MAGIC + 14,
22 | MEM_CHECK_MAGIC + 15,
23 | };
24 |
25 | EWRAM_CODE bool checkROM(unsigned int mask)
26 | {
27 | REG_WSCNT = mask;
28 |
29 | // check sequential read (S)
30 | for (int i = 0; i < MEM_CHECK_SIZE; i++)
31 | {
32 | if (*(volatile int*)&ROM_MAGIC[i] != (MEM_CHECK_MAGIC + i))
33 | {
34 | REG_WSCNT = WS_ROM0_N4 | WS_ROM0_S2 | WS_PREFETCH;
35 | return false;
36 | }
37 | }
38 |
39 | // check non-sequential read (N)
40 | for (int i = 0, j = MEM_CHECK_SIZE - 1; i < MEM_CHECK_SIZE; i++, j--)
41 | {
42 | bool L = *(volatile int*)&ROM_MAGIC[i] == (MEM_CHECK_MAGIC + i);
43 | bool R = *(volatile int*)&ROM_MAGIC[j] == (MEM_CHECK_MAGIC + j);
44 |
45 | if (L && R) continue;
46 |
47 | REG_WSCNT = WS_ROM0_N4 | WS_ROM0_S2 | WS_PREFETCH;
48 | return false;
49 | }
50 |
51 | return true;
52 | }
--------------------------------------------------------------------------------
/src/platform/gba/data/GYM.PKD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/data/GYM.PKD
--------------------------------------------------------------------------------
/src/platform/gba/data/LEVEL1.PKD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/data/LEVEL1.PKD
--------------------------------------------------------------------------------
/src/platform/gba/data/LEVEL2.PKD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/data/LEVEL2.PKD
--------------------------------------------------------------------------------
/src/platform/gba/data/TITLE.PKD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/data/TITLE.PKD
--------------------------------------------------------------------------------
/src/platform/gba/data/TITLE.SCR:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/data/TITLE.SCR
--------------------------------------------------------------------------------
/src/platform/gba/data/TRACKS.AD4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/data/TRACKS.AD4
--------------------------------------------------------------------------------
/src/platform/gba/deploy.sh:
--------------------------------------------------------------------------------
1 | make
2 | ./mGBA.exe C:\\Projects\\OpenLara\\src\\platform\\gba\\OpenLara.gba
3 |
--------------------------------------------------------------------------------
/src/platform/gba/labels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/labels.png
--------------------------------------------------------------------------------
/src/platform/gba/packer/TR1_PSX.h:
--------------------------------------------------------------------------------
1 | #ifndef H_TR1_PSX
2 | #define H_TR1_PSX
3 |
4 | struct TR1_PSX
5 | {
6 | //
7 | };
8 |
9 | #endif
--------------------------------------------------------------------------------
/src/platform/gba/packer/libimagequant/blur.h:
--------------------------------------------------------------------------------
1 | #ifndef BLUR_H
2 | #define BLUR_H
3 |
4 | LIQ_PRIVATE void liq_blur(unsigned char *src, unsigned char *tmp, unsigned char *dst, unsigned int width, unsigned int height, unsigned int size);
5 | LIQ_PRIVATE void liq_max3(unsigned char *src, unsigned char *dst, unsigned int width, unsigned int height);
6 | LIQ_PRIVATE void liq_min3(unsigned char *src, unsigned char *dst, unsigned int width, unsigned int height);
7 |
8 | #endif
9 |
--------------------------------------------------------------------------------
/src/platform/gba/packer/libimagequant/kmeans.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef KMEANS_H
3 | #define KMEANS_H
4 |
5 | // Spread memory touched by different threads at least 64B apart which I assume is the cache line size. This should avoid memory write contention.
6 | #define KMEANS_CACHE_LINE_GAP ((64+sizeof(kmeans_state)-1)/sizeof(kmeans_state))
7 |
8 | typedef struct {
9 | double a, r, g, b, total;
10 | } kmeans_state;
11 |
12 | typedef void (*kmeans_callback)(hist_item *item, float diff);
13 |
14 | LIQ_PRIVATE void kmeans_init(const colormap *map, const unsigned int max_threads, kmeans_state state[]);
15 | LIQ_PRIVATE void kmeans_update_color(const f_pixel acolor, const float value, const colormap *map, unsigned int match, const unsigned int thread, kmeans_state average_color[]);
16 | LIQ_PRIVATE void kmeans_finalize(colormap *map, const unsigned int max_threads, const kmeans_state state[]);
17 | LIQ_PRIVATE double kmeans_do_iteration(histogram *hist, colormap *const map, kmeans_callback callback);
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/src/platform/gba/packer/libimagequant/mediancut.h:
--------------------------------------------------------------------------------
1 | #ifndef MEDIANCUT_H
2 | #define MEDIANCUT_H
3 |
4 | LIQ_PRIVATE colormap *mediancut(histogram *hist, unsigned int newcolors, const double target_mse, const double max_mse, void* (*malloc)(size_t), void (*free)(void*));
5 |
6 | #endif
7 |
--------------------------------------------------------------------------------
/src/platform/gba/packer/libimagequant/mempool.h:
--------------------------------------------------------------------------------
1 | #ifndef MEMPOOL_H
2 | #define MEMPOOL_H
3 |
4 | #include
5 |
6 | struct mempool;
7 | typedef struct mempool *mempoolptr;
8 |
9 | LIQ_PRIVATE void* mempool_create(mempoolptr *mptr, const unsigned int size, unsigned int capacity, void* (*malloc)(size_t), void (*free)(void*));
10 | LIQ_PRIVATE void* mempool_alloc(mempoolptr *mptr, const unsigned int size, const unsigned int capacity);
11 | LIQ_PRIVATE void mempool_destroy(mempoolptr m);
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/src/platform/gba/packer/libimagequant/nearest.h:
--------------------------------------------------------------------------------
1 | //
2 | // nearest.h
3 | // pngquant
4 | //
5 |
6 | #ifndef NEAREST_H
7 | #define NEAREST_H
8 |
9 | struct nearest_map;
10 | LIQ_PRIVATE struct nearest_map *nearest_init(const colormap *palette);
11 | LIQ_PRIVATE unsigned int nearest_search(const struct nearest_map *map, const f_pixel *px, const int palette_index_guess, float *diff);
12 | LIQ_PRIVATE void nearest_free(struct nearest_map *map);
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/src/platform/gba/packer/packer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30907.101
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "packer", "packer.vcxproj", "{CED88939-237F-4F70-872C-704A51F7B8E5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {CED88939-237F-4F70-872C-704A51F7B8E5}.Debug|x64.ActiveCfg = Debug|x64
17 | {CED88939-237F-4F70-872C-704A51F7B8E5}.Debug|x64.Build.0 = Debug|x64
18 | {CED88939-237F-4F70-872C-704A51F7B8E5}.Debug|x86.ActiveCfg = Debug|Win32
19 | {CED88939-237F-4F70-872C-704A51F7B8E5}.Debug|x86.Build.0 = Debug|Win32
20 | {CED88939-237F-4F70-872C-704A51F7B8E5}.Release|x64.ActiveCfg = Release|x64
21 | {CED88939-237F-4F70-872C-704A51F7B8E5}.Release|x64.Build.0 = Release|x64
22 | {CED88939-237F-4F70-872C-704A51F7B8E5}.Release|x86.ActiveCfg = Release|Win32
23 | {CED88939-237F-4F70-872C-704A51F7B8E5}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {A0748762-B1DD-4990-8016-21AD34BA8501}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/src/platform/gba/packer/packer.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/platform/gba/packer/tracks/ad4.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/packer/tracks/ad4.exe
--------------------------------------------------------------------------------
/src/platform/gba/packer/tracks/convertToMono.bat:
--------------------------------------------------------------------------------
1 | set IN_FOLDER=orig\
2 | set OUT_FOLDER=orig_mono\
3 |
4 | for /r %IN_FOLDER% %%i in (*.ogg) do (
5 | ffmpeg -y -i %%i temp.wav
6 | poly2mono temp.wav %OUT_FOLDER%%%~ni.wav -window:sine -blocksize:8192 -nhops:2
7 | )
8 | del temp.wav
9 |
--------------------------------------------------------------------------------
/src/platform/gba/packer/tracks/cygwin1.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/packer/tracks/cygwin1.dll
--------------------------------------------------------------------------------
/src/platform/gba/packer/tracks/poly2mono.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gba/packer/tracks/poly2mono.exe
--------------------------------------------------------------------------------
/src/platform/gcw0/build.sh:
--------------------------------------------------------------------------------
1 | set -e
2 | /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-g++ -o OpenLara -D__GCW0__ -std=c++11 -Os -s -g0 -mips32r2 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -L/opt/vc/lib/ -lGLESv2 -lEGL -lm -lpthread -lasound
3 | /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note
4 |
--------------------------------------------------------------------------------
/src/platform/gcw0/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/gcw0/icon.png
--------------------------------------------------------------------------------
/src/platform/gcw0/make_opk.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | OPK_NAME=OpenLara.opk
4 |
5 | echo ${OPK_NAME}
6 |
7 | # create default.gcw0.desktop
8 | cat > default.gcw0.desktop <
2 |
3 | @class ViewController;
4 |
5 | @interface AppDelegate : UIResponder
6 |
7 | @property (strong, nonatomic) UIWindow *window;
8 |
9 | @end
10 |
--------------------------------------------------------------------------------
/src/platform/ios/AppDelegate.mm:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 | #import "ViewController.h"
3 |
4 | @implementation AppDelegate
5 |
6 | @synthesize window = _window;
7 |
8 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
9 | [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
10 |
11 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
12 | self.window.rootViewController = [[ViewController alloc] init];
13 | [self.window makeKeyAndVisible];
14 |
15 | return YES;
16 | }
17 |
18 | - (void)applicationWillResignActive:(UIApplication *)application {
19 |
20 | }
21 |
22 | - (void)applicationDidEnterBackground:(UIApplication *)application {
23 |
24 | }
25 |
26 | - (void)applicationWillEnterForeground:(UIApplication *)application {
27 | //
28 | }
29 |
30 | - (void)applicationDidBecomeActive:(UIApplication *)application {
31 | //
32 | }
33 |
34 | - (void)applicationWillTerminate:(UIApplication *)application {
35 | //
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/src/platform/ios/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/ios/Default-568h@2x.png
--------------------------------------------------------------------------------
/src/platform/ios/ViewController.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface ViewController : GLKViewController
5 | {
6 | NSMutableArray *m_touchList;
7 | }
8 |
9 | @end
10 |
--------------------------------------------------------------------------------
/src/platform/ios/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/src/platform/ios/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import "AppDelegate.h"
3 |
4 | int main(int argc, char *argv[])
5 | {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/platform/ios/openlara-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | OpenLara
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIcons
12 |
13 | CFBundlePrimaryIcon
14 |
15 | CFBundleIconFiles
16 |
17 | icon.png
18 |
19 | UIPrerenderedIcon
20 |
21 |
22 |
23 | CFBundleIdentifier
24 | $(PRODUCT_BUNDLE_IDENTIFIER)
25 | CFBundleInfoDictionaryVersion
26 | 6.0
27 | CFBundleName
28 | ${PRODUCT_NAME}
29 | CFBundlePackageType
30 | APPL
31 | CFBundleShortVersionString
32 | 0.1
33 | CFBundleSignature
34 | ????
35 | CFBundleVersion
36 | 0.1
37 | LSRequiresIPhoneOS
38 |
39 | UIRequiredDeviceCapabilities
40 |
41 | armv7
42 |
43 | UIRequiresFullScreen
44 |
45 | UIStatusBarHidden
46 |
47 | UIStatusBarHidden~ipad
48 |
49 | UISupportedInterfaceOrientations
50 |
51 | UIInterfaceOrientationLandscapeLeft
52 | UIInterfaceOrientationLandscapeRight
53 |
54 | UISupportedInterfaceOrientations~ipad
55 |
56 | UIInterfaceOrientationLandscapeLeft
57 | UIInterfaceOrientationLandscapeRight
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/src/platform/ios/openlara-Prefix.pch:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #ifndef __IPHONE_3_0
4 | #warning "This project uses features only available in iOS SDK 3.0 and later."
5 | #endif
6 |
7 | #ifdef __OBJC__
8 | #import
9 | #import
10 | #endif
11 |
--------------------------------------------------------------------------------
/src/platform/nix/.vscode/OpenLara.code-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "folders": [
3 | {
4 | "path": ".."
5 | },
6 | {
7 | "path": "../../.."
8 | }
9 | ],
10 | "settings": {
11 | "files.associations": {
12 | "typeinfo": "cpp"
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/platform/nix/.vscode/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Linux",
5 | "includePath": [
6 | "${workspaceFolder}/**"
7 | ],
8 | "defines": [],
9 | "compilerPath": "/usr/bin/clang",
10 | "cStandard": "c11",
11 | "cppStandard": "c++11",
12 | "intelliSenseMode": "clang-x64"
13 | }
14 | ],
15 | "version": 4
16 | }
--------------------------------------------------------------------------------
/src/platform/nix/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "(gdb) Launch",
5 | "type": "cppdbg",
6 | "request": "launch",
7 | "program": "${workspaceFolder}/../../../bin/OpenLara",
8 | "args": [],
9 | "stopAtEntry": false,
10 | "cwd": "${workspaceFolder}/../../../bin/",
11 | "environment": [],
12 | "externalConsole": false,
13 | "MIMode": "gdb",
14 | "setupCommands": [
15 | {
16 | "description": "Enable pretty-printing for gdb",
17 | "text": "-enable-pretty-printing",
18 | "ignoreFailures": true
19 | }
20 | ]
21 | }
22 |
23 | ]
24 | }
--------------------------------------------------------------------------------
/src/platform/nix/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "files.associations": {
3 | "typeinfo": "cpp"
4 | }
5 | }
--------------------------------------------------------------------------------
/src/platform/nix/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version" : "2.0.0",
3 | "tasks": [
4 | {
5 | "type": "shell",
6 | "label": "C/C++: clang++ build active file",
7 | "command": "/usr/bin/clang++",
8 | "args": [
9 | "-std=c++11",
10 | "-Os",
11 | "-s",
12 | "-fno-exceptions",
13 | "-fno-rtti",
14 | "-ffunction-sections",
15 | "-fdata-sections",
16 | "-Wl,--gc-sections",
17 | "-Wno-invalid-source-encoding",
18 | "-DNDEBUG",
19 | "-D_POSIX_THREADS",
20 | "-D_POSIX_READER_WRITER_LOCKS",
21 | "main.cpp",
22 | "../../libs/stb_vorbis/stb_vorbis.c",
23 | "../../libs/minimp3/minimp3.cpp",
24 | "../../libs/tinf/tinflate.c",
25 | "-I../../",
26 | "-lX11",
27 | "-lGL",
28 | "-lm",
29 | "-lpthread",
30 | "-lpulse-simple",
31 | "-lpulse",
32 | "-o",
33 | "../../../bin/OpenLara"
34 | ],
35 | "options": {
36 | "cwd": "${workspaceFolder}"
37 | },
38 | "problemMatcher": [
39 | "$gcc"
40 | ],
41 | "group": {
42 | "kind": "build",
43 | "isDefault": true
44 | }
45 | }
46 | ]
47 | }
--------------------------------------------------------------------------------
/src/platform/nix/build.sh:
--------------------------------------------------------------------------------
1 | set -e
2 | clang++ -std=c++11 -Os -s -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding -DNDEBUG -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o../../../bin/OpenLara -lX11 -lGL -lm -lpthread -lpulse-simple -lpulse
3 | strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note
4 |
--------------------------------------------------------------------------------
/src/platform/nix/build_e2k.sh:
--------------------------------------------------------------------------------
1 | set -e
2 | g++ -std=c++11 -O4 -s -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding -DELBRUS -DNDEBUG -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o../../../bin/OpenLara -lX11 -lGL -lm -lpthread -lpulse-simple -lpulse
3 | strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note
4 |
--------------------------------------------------------------------------------
/src/platform/nix/howto.txt:
--------------------------------------------------------------------------------
1 | sudo apt-get install git clang libx11-dev libgl1-mesa-dev libpulse-dev
2 | git clone https://github.com/XProger/OpenLara
3 | cd OpenLara/src/platform/nix
4 | ./build.sh
5 | cd ../../../bin/
6 | ./OpenLara
--------------------------------------------------------------------------------
/src/platform/nix/premake5.lua:
--------------------------------------------------------------------------------
1 | workspace "OpenLara"
2 | configurations { "Debug", "Release" }
3 |
4 | project "OpenLara"
5 | kind "ConsoleApp"
6 | language "C++"
7 | includedirs { "../../" }
8 | exceptionhandling "Off"
9 | rtti "Off"
10 |
11 | files { "main.cpp", "../../libs/stb_vorbis/stb_vorbis.c", "../../libs/minimp3/minimp3.cpp", "../../libs/tinf/tinflate.c" }
12 |
13 | filter { "system:Linux", "toolset:gcc or clang" }
14 | links { "X11", "GL", "m", "pthread", "pulse-simple", "pulse" }
15 | defines { "POSIX_THREADS", "POSIX_READER_WRITER_LOCKS" }
16 |
17 | filter "configurations:Debug"
18 | defines { "DEBUG" }
19 | symbols "On"
20 |
21 | filter "configurations:Release"
22 | defines { "NDEBUG" }
23 | optimize "Size"
24 |
--------------------------------------------------------------------------------
/src/platform/nx/deploy.bat:
--------------------------------------------------------------------------------
1 | C:\devkitPro\tools\bin\nxlink.exe -a 192.168.1.46 OpenLara.nro
--------------------------------------------------------------------------------
/src/platform/nx/icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/nx/icon.jpg
--------------------------------------------------------------------------------
/src/platform/osx/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "size" : "16x16",
10 | "idiom" : "mac",
11 | "filename" : "icon16x16@2x.png",
12 | "scale" : "2x"
13 | },
14 | {
15 | "idiom" : "mac",
16 | "size" : "32x32",
17 | "scale" : "1x"
18 | },
19 | {
20 | "size" : "32x32",
21 | "idiom" : "mac",
22 | "filename" : "icon32x32@2x.png",
23 | "scale" : "2x"
24 | },
25 | {
26 | "size" : "128x128",
27 | "idiom" : "mac",
28 | "filename" : "icon128x128.png",
29 | "scale" : "1x"
30 | },
31 | {
32 | "idiom" : "mac",
33 | "size" : "128x128",
34 | "scale" : "2x"
35 | },
36 | {
37 | "size" : "256x256",
38 | "idiom" : "mac",
39 | "filename" : "icon256x256.png",
40 | "scale" : "1x"
41 | },
42 | {
43 | "idiom" : "mac",
44 | "size" : "256x256",
45 | "scale" : "2x"
46 | },
47 | {
48 | "size" : "512x512",
49 | "idiom" : "mac",
50 | "filename" : "icon512x512.png",
51 | "scale" : "1x"
52 | },
53 | {
54 | "idiom" : "mac",
55 | "size" : "512x512",
56 | "scale" : "2x"
57 | }
58 | ],
59 | "info" : {
60 | "version" : 1,
61 | "author" : "xcode"
62 | }
63 | }
--------------------------------------------------------------------------------
/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon128x128.png
--------------------------------------------------------------------------------
/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon16x16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon16x16@2x.png
--------------------------------------------------------------------------------
/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon256x256.png
--------------------------------------------------------------------------------
/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon32x32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon32x32@2x.png
--------------------------------------------------------------------------------
/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/osx/Assets.xcassets/AppIcon.appiconset/icon512x512.png
--------------------------------------------------------------------------------
/src/platform/osx/OpenLara-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | Bundle display name
12 | OpenLara
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 0.1
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSApplicationCategoryType
26 | public.app-category.games
27 | LSMinimumSystemVersion
28 | ${MACOSX_DEPLOYMENT_TARGET}
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/platform/psc/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This should really be a makefile with individual platforms but for now...
3 | set -e
4 | # General Info
5 | GIT_COMMIT=$(echo "`git rev-parse --short HEAD``git diff-index --quiet HEAD -- || echo '-dirty'`")
6 |
7 | # Build Rules
8 | [ -z "CXX" ] && CXX="arm-linux-gnueabihf-g++-8"
9 | CFLAGS="-std=c++11 -Os -s -g -marm -march=armv8-a -mtune=cortex-a35 -mfpu=neon-fp-armv8 -mfloat-abi=hard -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections"
10 | LDFLAGS="-Wl,--gc-sections -static-libgcc -static-libstdc++"
11 | DEFINES="-DNDEBUG -D__PSC__"
12 | SRC="main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c"
13 | INCLUDES="-I/usr/arm-linux-gnueabihf/include/ -I../../"
14 | LIBS="-L$LD_LIBRARY_PATH -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev -lwayland-client -lwayland-egl"
15 | TARGET="-o../../../bin/OpenLara"
16 |
17 | clear
18 | echo "-------------------------------------------------------------------------------"
19 | echo "OpenLara Builder v0.1 - OpenLara Build $GIT_COMMIT"
20 | echo "-------------------------------------------------------------------------------"
21 | echo "Build Rules:"
22 | echo "CFLAGS: $CFLAGS"
23 | echo "LDFLAGS: $LDFLAGS"
24 | echo "DEFINES: $DEFINES"
25 | echo "SRC: $SRC"
26 | echo "INCLUDES: $INCLUDES"
27 | echo "LIBS: $LIBS"
28 | echo "TARGET: $TARGET"
29 | echo "-------------------------------------------------------------------------------"
30 | echo
31 |
32 | $CXX $CFLAGS $LDFLAGS $DEFINES $SRC $INCLUDES $LIBS $TARGET
--------------------------------------------------------------------------------
/src/platform/psp/ICON0.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/psp/ICON0.PNG
--------------------------------------------------------------------------------
/src/platform/psp/Makefile:
--------------------------------------------------------------------------------
1 | TARGET = OpenLara
2 | OBJS = main.o ../../libs/stb_vorbis/stb_vorbis.o
3 |
4 | INCDIR = ../../
5 | CFLAGS = -G0 -O3
6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -Wno-invalid-offsetof
7 | ASFLAGS = $(CFLAGS)
8 |
9 | BUILD_PRX = 1
10 |
11 | LIBDIR =
12 | LDFLAGS =
13 | LIBS = -lpspgum -lpspgu -lpspaudiolib -lpspaudio -lpsprtc -lpsppower -lpspmath -lm -lstdc++
14 |
15 | COPY_DIR = D:/Games/PSP/memstick/PSP/GAME/OL/
16 | EXTRA_TARGETS = EBOOT.PBP
17 | PSP_EBOOT_TITLE = OpenLara
18 | PSP_EBOOT_ICON = ICON0.PNG
19 | PSP_EBOOT_PIC1 = PIC1.PNG
20 |
21 | PSPSDK = $(shell psp-config --pspsdk-path)
22 | #USE_PSPSDK_LIBC=1
23 | include $(PSPSDK)/lib/build.mak
--------------------------------------------------------------------------------
/src/platform/psp/PIC1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/psp/PIC1.PNG
--------------------------------------------------------------------------------
/src/platform/psv/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8)
2 |
3 | if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
4 | if(DEFINED ENV{VITASDK})
5 | set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
6 | else()
7 | message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
8 | endif()
9 | endif()
10 |
11 |
12 | project(OpenLara)
13 |
14 | include("${VITASDK}/share/vita.cmake" REQUIRED)
15 |
16 | set(VITA_APP_NAME "OpenLara")
17 | set(VITA_TITLEID "OPENLARA1")
18 | set(VITA_VERSION "01.00")
19 |
20 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -Wall")
21 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 -std=c++11")
22 | set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
23 |
24 | include_directories(
25 | ../..
26 | )
27 |
28 | link_directories(
29 | ${CMAKE_CURRENT_BINARY_DIR}
30 | )
31 |
32 | add_executable(OpenLara
33 | main.cpp
34 | ../../libs/stb_vorbis/stb_vorbis.c
35 | ../../libs/tinf/tinflate.c
36 | )
37 |
38 | target_link_libraries(OpenLara
39 | SceLibKernel_stub
40 | ScePower_stub
41 | SceRtc_stub
42 | SceDisplay_stub
43 | SceGxm_stub
44 | SceCtrl_stub
45 | SceAudio_stub
46 | SceTouch_stub
47 | SceAppUtil_stub
48 | )
49 |
50 |
51 | vita_create_self(OpenLara.self OpenLara)
52 | vita_create_vpk(OpenLara.vpk ${VITA_TITLEID} OpenLara.self
53 | VERSION ${VITA_VERSION}
54 | NAME ${VITA_APP_NAME}
55 | FILE sce_sys/icon0.png sce_sys/icon0.png
56 | FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
57 | FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
58 | FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
59 | )
60 |
--------------------------------------------------------------------------------
/src/platform/psv/deploy.bat:
--------------------------------------------------------------------------------
1 | curl --ftp-method nocwd -T OpenLara.self ftp://192.168.1.39:1337/ux0:/app/OPENLARA1/eboot.bin
--------------------------------------------------------------------------------
/src/platform/psv/deploy.sh:
--------------------------------------------------------------------------------
1 | make
2 | curl --ftp-method nocwd -T OpenLara.self ftp://192.168.1.59:1337/ux0:/app/OPENLARA1/eboot.bin
3 | echo launch OPENLARA1 | ./nc.exe 192.168.1.59 1338
4 |
--------------------------------------------------------------------------------
/src/platform/psv/sce_sys/icon0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/psv/sce_sys/icon0.png
--------------------------------------------------------------------------------
/src/platform/psv/sce_sys/livearea/contents/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/psv/sce_sys/livearea/contents/bg.png
--------------------------------------------------------------------------------
/src/platform/psv/sce_sys/livearea/contents/startup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/psv/sce_sys/livearea/contents/startup.png
--------------------------------------------------------------------------------
/src/platform/psv/sce_sys/livearea/contents/template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bg.png
6 |
7 |
8 |
9 | startup.png
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/platform/rpi/Makefile:
--------------------------------------------------------------------------------
1 | OBJS=OpenLara.o
2 | BIN=../../../bin/OpenLara.bin
3 |
4 | CFLAGS+=-D__RPI__
5 | LDFLAGS+=-L$(SDKSTAGE)/opt/vc/lib/ -lbrcmGLESv2 -lbrcmEGL -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -lm -L$(SDKSTAGE)/opt/vc/src/hello_pi/libs/vgfont
6 |
7 | INCLUDES+=-I$(SDKSTAGE)/opt/vc/include/ -I$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -I$(SDKSTAGE)/opt/vc/include/interface/vmcs_host/linux -I./
8 |
9 | all: $(BIN) $(LIB)
10 |
11 | %.o: %.c
12 | @rm -f $@
13 | $(CC) $(CFLAGS) $(INCLUDES) -g -c $< -o $@ -Wno-deprecated-declarations
14 |
15 | %.o: %.cpp
16 | @rm -f $@
17 | $(CXX) $(CFLAGS) $(INCLUDES) -g -c $< -o $@ -Wno-deprecated-declarations
18 |
19 | %.bin: $(OBJS)
20 | $(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
21 |
22 | %.a: $(OBJS)
23 | $(AR) r $@ $^
24 |
25 | clean:
26 | for i in $(OBJS); do (if test -e "$$i"; then ( rm $$i ); fi ); done
27 | @rm -f $(BIN) $(LIB)
28 |
29 |
--------------------------------------------------------------------------------
/src/platform/rpi/build.sh:
--------------------------------------------------------------------------------
1 | set -e
2 | clang++ -std=c++11 -Os -s -g -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding -DNDEBUG -D__RPI__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -o../../../bin/OpenLara -L/opt/vc/lib/ -lbrcmGLESv2 -lbrcmEGL -lm -lrt -lpthread -lasound -lbcm_host -ludev
3 | strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note
4 |
--------------------------------------------------------------------------------
/src/platform/sdl2/Makefile:
--------------------------------------------------------------------------------
1 | SRCS=main.cpp \
2 | ../../libs/stb_vorbis/stb_vorbis.c \
3 | ../../libs/minimp3/minimp3.cpp \
4 | ../../libs/tinf/tinflate.c
5 | CC=g++
6 |
7 | SDL_CFLAGS := $(shell sdl2-config --cflags)
8 | SDL_LDFLAGS := $(shell sdl2-config --libs)
9 |
10 | CFLAGS+=-DSDL2_GLES -D_GAPI_GLES2 -std=c++11 -O3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -D__SDL2__ $(SDL_CFLAGS) -Wall
11 | LDFLAGS+=-lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev $(SDL_LDFLAGS)
12 |
13 | INCLUDES+=-I../../
14 |
15 | openlara :
16 | $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(SRCS) -o $@
17 |
18 | install : openlara
19 | install -d $(DESTDIR)$(PREFIX)/bin/
20 | install openlara $(DESTDIR)$(PREFIX)/bin/OpenLara
21 |
22 | uninstall :
23 | rm -f $(DESTDIR)$(PREFIX)/bin/OpenLara
24 |
25 | clean:
26 | rm -f OpenLara
27 |
28 |
--------------------------------------------------------------------------------
/src/platform/sdl2/build.sh:
--------------------------------------------------------------------------------
1 | set -e
2 |
3 | # Use this compilation line to build SDL2/GLES version, GLES2 version.
4 | g++ -DSDL2_GLES -D_GAPI_GLES2 -std=c++11 `sdl2-config --cflags` -O3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__SDL2__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o OpenLara `sdl2-config --libs` -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev
5 |
6 | # Use this compilation line to build SDL2/GLES version, GLES3, which is an extension to GLES2 so we use -lGLESv2, too.
7 | #g++ -DSDL2_GLES -std=c++11 `sdl2-config --cflags` -O3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__SDL2__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o OpenLara `sdl2-config --libs` -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev
8 |
9 | # Use this compilation line to build SDL2/OpenGL version.
10 | #g++ -std=c++11 `sdl2-config --cflags` -O3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__SDL2__ -D_SDL2_OPENGL main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o OpenLara `sdl2-config --libs` -lGL -lm -lrt -lpthread -lasound -ludev
11 |
--------------------------------------------------------------------------------
/src/platform/tns/Makefile:
--------------------------------------------------------------------------------
1 | DEBUG = FALSE
2 |
3 | GCC = nspire-gcc
4 | AS = nspire-as
5 | GXX = nspire-g++
6 | LD = nspire-ld
7 | GENZEHN = genzehn
8 |
9 | GCCFLAGS = -marm -march=armv5te -mtune=arm926ej-s -std=c++11 -flto -ffast-math -fomit-frame-pointer -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -D__TNS__ -I../../fixed/
10 | LDFLAGS = -Wl,--gc-sections -Wl,--as-needed -flto -Wno-alloc-size-larger-than
11 | ZEHNFLAGS = --name "OpenLara"
12 |
13 | ifeq ($(DEBUG),FALSE)
14 | GCCFLAGS += -Ofast
15 | else
16 | GCCFLAGS += -O0 -g
17 | endif
18 |
19 | OBJS = $(patsubst %.c, %.o, $(shell find . -name \*.c))
20 | OBJS += $(patsubst %.cpp, %.o, $(shell find . -name \*.cpp))
21 | OBJS += $(patsubst %.s, %.o, $(shell find . -name \*.s))
22 | EXE = OpenLara
23 | DISTDIR = .
24 | vpath %.tns $(DISTDIR)
25 | vpath %.elf $(DISTDIR)
26 |
27 | all: $(EXE).prg.tns
28 |
29 | %.o: %.c
30 | $(GCC) $(GCCFLAGS) -c $<
31 |
32 | %.o: %.cpp
33 | $(GXX) $(GCCFLAGS) -c $<
34 |
35 | %.o: %.s
36 | $(AS) -c $<
37 |
38 | $(EXE).elf: $(OBJS)
39 | cp ../gba/render.iwram.cpp render.cpp
40 | mkdir -p $(DISTDIR)
41 | $(LD) $^ -o $(DISTDIR)/$@ $(LDFLAGS)
42 |
43 | $(EXE).tns: $(EXE).elf
44 | $(GENZEHN) --input $(DISTDIR)/$^ --output $(DISTDIR)/$@ $(ZEHNFLAGS)
45 |
46 | $(EXE).prg.tns: $(EXE).tns
47 | make-prg $(DISTDIR)/$^ $(DISTDIR)/$@
48 |
49 | clean:
50 | rm -f *.o $(DISTDIR)/$(EXE).tns $(DISTDIR)/$(EXE).elf $(DISTDIR)/$(EXE).prg.tns
51 |
--------------------------------------------------------------------------------
/src/platform/tns/sound.cpp:
--------------------------------------------------------------------------------
1 | #include "common.h"
2 |
3 | void sndInit()
4 | {
5 | // TODO
6 | }
7 |
8 | void sndInitSamples()
9 | {
10 | // TODO
11 | }
12 |
13 | void sndFreeSamples()
14 | {
15 | // TODO
16 | }
17 |
18 | void* sndPlaySample(int32 index, int32 volume, int32 pitch, int32 mode)
19 | {
20 | return NULL; // TODO
21 | }
22 |
23 | void sndPlayTrack(int32 track)
24 | {
25 | // TODO
26 | }
27 |
28 | void sndStopTrack()
29 | {
30 | // TODO
31 | }
32 |
33 | bool sndTrackIsPlaying()
34 | {
35 | return false; // TODO
36 | }
37 |
38 | void sndStopSample(int32 index)
39 | {
40 | // TODO
41 | }
42 |
43 | void sndStop()
44 | {
45 | // TODO
46 | }
47 |
48 | void sndFill(uint8* buffer, int32 count)
49 | {
50 | // TODO
51 | }
52 |
--------------------------------------------------------------------------------
/src/platform/web/.htaccess:
--------------------------------------------------------------------------------
1 | AddEncoding gzip .gz
2 |
3 |
4 | ForceType text/javascript
5 | Header set Content-Encoding: gzip
6 |
7 |
8 |
9 | ForceType application/octet-stream
10 | Header set Content-Encoding: gzip
11 |
12 |
13 |
14 | ForceType application/octet-stream
15 | Header set Content-Encoding: gzip
16 |
17 |
18 |
19 | ForceType application/octet-stream
20 | Header set Content-Encoding: gzip
21 |
22 |
23 | RewriteEngine on
24 | RewriteCond %{HTTP:Accept-Encoding} gzip
25 | RewriteCond %{REQUEST_FILENAME}.gz -f
26 | RewriteRule ^(.+)\.(js|data|mem|wasm)$ $1.$2.gz [L]
--------------------------------------------------------------------------------
/src/platform/web/build.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | cls
3 | set SRC=main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/tinf/tinflate.c
4 | set PROJ=OpenLara
5 | set FLAGS=-O3 -ffast-math -Wno-deprecated-register --llvm-opts 2 -fmax-type-align=2 -std=c++11 -s ALLOW_MEMORY_GROWTH=1 -s USE_WEBGL2=1 -Wall -Wno-invalid-source-encoding -I../../
6 | echo.
7 | call em++ %SRC% %FLAGS% -o %PROJ%.js --preload-file ./level/1/TITLE.PSX --preload-file ./audio/1/dummy --preload-file ./audio/2/dummy --preload-file ./audio/3/dummy --preload-file ./level/2/dummy --preload-file ./level/3/dummy
8 | gzip.exe -9 -f %PROJ%.data %PROJ%.js %PROJ%.js.mem
--------------------------------------------------------------------------------
/src/platform/web/build_wasm.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | cls
3 | set SRC=main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/tinf/tinflate.c
4 | set PROJ=OpenLara_wasm
5 | set FLAGS=-s WASM=1 -O3 -ffast-math -Wno-deprecated-register --llvm-opts 2 -fmax-type-align=2 -std=c++11 -s USE_WEBGL2=1 -Wall -Wno-invalid-source-encoding -I../../
6 | echo.
7 | call em++ %SRC% %FLAGS% -o %PROJ%.js --preload-file ./level/1/TITLE.PSX --preload-file ./audio/1/dummy --preload-file ./audio/2/dummy --preload-file ./audio/3/dummy --preload-file ./level/2/dummy --preload-file ./level/3/dummy
8 | gzip.exe -9 -f %PROJ%.data %PROJ%.js %PROJ%.wasm %PROJ%.js.mem load-wasm-worker.js
--------------------------------------------------------------------------------
/src/platform/web/level/.htaccess:
--------------------------------------------------------------------------------
1 | AddEncoding gzip .gz
2 |
3 |
4 | ForceType application/octet-stream
5 | Header set Content-Encoding: gzip
6 |
7 |
8 |
9 | ForceType application/octet-stream
10 | Header set Content-Encoding: gzip
11 |
12 |
13 |
14 | ForceType application/octet-stream
15 | Header set Content-Encoding: gzip
16 |
--------------------------------------------------------------------------------
/src/platform/win/OpenLara.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/win/OpenLara.rc
--------------------------------------------------------------------------------
/src/platform/win/OpenLara.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.1022
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenLara", "OpenLara.vcxproj", "{6935E070-59B8-418A-9241-70BACB4217B5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Win32 = Debug|Win32
11 | Release|Win32 = Release|Win32
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {6935E070-59B8-418A-9241-70BACB4217B5}.Debug|Win32.ActiveCfg = Debug|Win32
15 | {6935E070-59B8-418A-9241-70BACB4217B5}.Debug|Win32.Build.0 = Debug|Win32
16 | {6935E070-59B8-418A-9241-70BACB4217B5}.Release|Win32.ActiveCfg = Release|Win32
17 | {6935E070-59B8-418A-9241-70BACB4217B5}.Release|Win32.Build.0 = Release|Win32
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {969CCE82-3511-4643-9273-4B4554C4E782}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/src/platform/win/OpenLara.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ..\..\..\bin\TR1_PSX
5 | WindowsLocalDebugger
6 |
7 |
8 |
9 |
10 | ..\..\..\bin\TR1_PSX
11 | WindowsLocalDebugger
12 |
13 |
14 | ..\..\..\bin\TR1_PSX
15 | WindowsLocalDebugger
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/platform/win/compile_mingw.bat:
--------------------------------------------------------------------------------
1 | C:\MinGW\bin\mingw32-g++ -static-libstdc++ -static-libgcc -O3 -s -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DWIN32 -DNDEBUG -DNO_TOUCH_SUPPORT -I../../libs/ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o../../../bin/OpenLara_mingw.exe -lopengl32 -lwinmm -lwsock32 -lgdi32 -lm
--------------------------------------------------------------------------------
/src/platform/win/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/win/icon.ico
--------------------------------------------------------------------------------
/src/platform/win/wcrt.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/win/wcrt.lib
--------------------------------------------------------------------------------
/src/platform/win_fixed/OpenLara.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/win_fixed/OpenLara.rc
--------------------------------------------------------------------------------
/src/platform/win_fixed/OpenLara.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.1022
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenLara", "OpenLara.vcxproj", "{6935E070-59B8-418A-9241-70BACB4217B5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Win32 = Debug|Win32
11 | Release|Win32 = Release|Win32
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {6935E070-59B8-418A-9241-70BACB4217B5}.Debug|Win32.ActiveCfg = Debug|Win32
15 | {6935E070-59B8-418A-9241-70BACB4217B5}.Debug|Win32.Build.0 = Debug|Win32
16 | {6935E070-59B8-418A-9241-70BACB4217B5}.Release|Win32.ActiveCfg = Release|Win32
17 | {6935E070-59B8-418A-9241-70BACB4217B5}.Release|Win32.Build.0 = Release|Win32
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {969CCE82-3511-4643-9273-4B4554C4E782}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/src/platform/win_fixed/OpenLara.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | render
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | lang
32 |
33 |
34 | fmt
35 |
36 |
37 | fmt
38 |
39 |
40 |
41 |
42 | {1d3e6f64-05d8-42b8-b2c6-c5bba7798936}
43 |
44 |
45 | {f297223e-368f-46b9-9f41-3e8075cbc5c2}
46 |
47 |
48 | {fe1fca63-da0d-4e31-b8c4-1d61eb02d01b}
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/platform/win_fixed/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/win_fixed/icon.ico
--------------------------------------------------------------------------------
/src/platform/win_fixed/sound.cpp:
--------------------------------------------------------------------------------
1 | #include "common.h"
2 |
3 | void sndInit()
4 | {
5 | // TODO
6 | }
7 |
8 | void sndInitSamples()
9 | {
10 | // TODO
11 | }
12 |
13 | void sndFreeSamples()
14 | {
15 | // TODO
16 | }
17 |
18 | void* sndPlaySample(int32 index, int32 volume, int32 pitch, int32 mode)
19 | {
20 | return NULL; // TODO
21 | }
22 |
23 | void sndPlayTrack(int32 track)
24 | {
25 | // TODO
26 | }
27 |
28 | void sndStopTrack()
29 | {
30 | // TODO
31 | }
32 |
33 | bool sndTrackIsPlaying()
34 | {
35 | return false; // TODO
36 | }
37 |
38 | void sndStopSample(int32 index)
39 | {
40 | // TODO
41 | }
42 |
43 | void sndStop()
44 | {
45 | // TODO
46 | }
47 |
48 | void sndFill(uint8* buffer, int32 count)
49 | {
50 | // TODO
51 | }
52 |
--------------------------------------------------------------------------------
/src/platform/wp8/OpenLara.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenLara", "OpenLara.vcxproj", "{D2F22E35-7E0D-457C-8401-1CB2FA4277C9}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|ARM = Debug|ARM
11 | Debug|Win32 = Debug|Win32
12 | Release|ARM = Release|ARM
13 | Release|Win32 = Release|Win32
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Debug|ARM.ActiveCfg = Debug|ARM
17 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Debug|ARM.Build.0 = Debug|ARM
18 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Debug|ARM.Deploy.0 = Debug|ARM
19 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Debug|Win32.ActiveCfg = Debug|Win32
20 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Debug|Win32.Build.0 = Debug|Win32
21 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Debug|Win32.Deploy.0 = Debug|Win32
22 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Release|ARM.ActiveCfg = Release|ARM
23 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Release|ARM.Build.0 = Release|ARM
24 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Release|ARM.Deploy.0 = Release|ARM
25 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Release|Win32.ActiveCfg = Release|Win32
26 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Release|Win32.Build.0 = Release|Win32
27 | {D2F22E35-7E0D-457C-8401-1CB2FA4277C9}.Release|Win32.Deploy.0 = Release|Win32
28 | EndGlobalSection
29 | GlobalSection(SolutionProperties) = preSolution
30 | HideSolutionNode = FALSE
31 | EndGlobalSection
32 | EndGlobal
33 |
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/src/platform/xb1/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/src/platform/xb1/OpenLara.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | UWPRemoteDebugger
5 | 192.168.1.49
6 |
7 |
8 | AppHostLocalDebugger
9 | 192.168.1.49
10 |
11 |
12 | UWPRemoteDebugger
13 | 192.168.1.49
14 |
15 |
16 | True
17 | False
18 | x64
19 | False
20 | 192.168.1.49
21 | True
22 |
23 |
--------------------------------------------------------------------------------
/src/platform/xb1/OpenLara_TemporaryKey.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xb1/OpenLara_TemporaryKey.pfx
--------------------------------------------------------------------------------
/src/platform/xb1/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | OpenLara
7 | XProger
8 | Assets\StoreLogo.png
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/platform/xbox/OpenLara.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 8.00
2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenLara", "OpenLara.vcproj", "{9DC80A4E-C379-4FB3-994E-62C358071007}"
3 | ProjectSection(ProjectDependencies) = postProject
4 | EndProjectSection
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfiguration) = preSolution
8 | Debug = Debug
9 | Profile = Profile
10 | Profile_FastCap = Profile_FastCap
11 | Release = Release
12 | Release_LTCG = Release_LTCG
13 | EndGlobalSection
14 | GlobalSection(ProjectConfiguration) = postSolution
15 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Debug.ActiveCfg = Debug|Xbox
16 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Debug.Build.0 = Debug|Xbox
17 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Profile.ActiveCfg = Profile|Xbox
18 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Profile.Build.0 = Profile|Xbox
19 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Profile_FastCap.ActiveCfg = Profile_FastCap|Xbox
20 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Profile_FastCap.Build.0 = Profile_FastCap|Xbox
21 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Release.ActiveCfg = Release|Xbox
22 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Release.Build.0 = Release|Xbox
23 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Release_LTCG.ActiveCfg = Release_LTCG|Xbox
24 | {9DC80A4E-C379-4FB3-994E-62C358071007}.Release_LTCG.Build.0 = Release_LTCG|Xbox
25 | EndGlobalSection
26 | GlobalSection(ExtensibilityGlobals) = postSolution
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityAddIns) = postSolution
29 | EndGlobalSection
30 | EndGlobal
31 |
--------------------------------------------------------------------------------
/src/platform/xbox/saveimage.xbx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xbox/saveimage.xbx
--------------------------------------------------------------------------------
/src/platform/xbox/titleimage.xbx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/platform/xbox/titleimage.xbx
--------------------------------------------------------------------------------
/src/shader.h:
--------------------------------------------------------------------------------
1 | #ifndef H_SHADER
2 | #define H_SHADER
3 |
4 | #include "core.h"
5 |
6 | struct Shader : GAPI::Shader {
7 |
8 | enum Type {
9 | DEFAULT = 0,
10 | SPRITE = 0, FLASH, ROOM, ENTITY, MIRROR,
11 | FILTER_UPSCALE = 0, FILTER_DOWNSAMPLE, FILTER_DOWNSAMPLE_DEPTH, FILTER_GRAYSCALE, FILTER_BLUR, FILTER_ANAGLYPH, FILTER_EQUIRECTANGULAR,
12 | WATER_DROP = 0, WATER_SIMULATE, WATER_CAUSTICS, WATER_RAYS, WATER_MASK, WATER_COMPOSE,
13 | SKY_TEXTURE = 0, SKY_CLOUDS, SKY_AZURE,
14 | MAX = 6
15 | };
16 |
17 | Shader(Core::Pass pass, Type type, int *def, int defCount) : GAPI::Shader() {
18 | init(pass, type, def, defCount);
19 | }
20 |
21 | virtual ~Shader() {
22 | deinit();
23 | }
24 |
25 | void setup() {
26 | bind();
27 | setParam(uViewProj, Core::mViewProj);
28 | setParam(uLightProj, Core::mLightProj);
29 | setParam(uViewPos, Core::viewPos);
30 | setParam(uParam, Core::params);
31 | }
32 | };
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/src/shaders/ambient.glsl:
--------------------------------------------------------------------------------
1 | R"====(
2 | uniform mat4 uViewProj;
3 | uniform vec4 uViewPos;
4 | uniform vec4 uFogParams;
5 |
6 | varying vec2 vTexCoord;
7 | varying vec4 vDiffuse;
8 |
9 | #ifdef VERTEX
10 |
11 | uniform vec4 uBasis[2];
12 | uniform vec4 uMaterial;
13 |
14 | attribute vec4 aCoord;
15 | attribute vec4 aTexCoord;
16 |
17 | attribute vec3 aColor;
18 | attribute vec3 aLight;
19 |
20 | vec3 mulQuat(vec4 q, vec3 v) {
21 | return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + v * q.w);
22 | }
23 |
24 | vec3 mulBasis(vec4 rot, vec3 pos, vec3 v) {
25 | return mulQuat(rot, v) + pos;
26 | }
27 |
28 | void main() {
29 | vTexCoord = aTexCoord.xy;
30 |
31 | vec4 rBasisRot = uBasis[0];
32 | vec4 rBasisPos = uBasis[1];
33 |
34 | vec3 coord =
35 | #ifdef TYPE_SPRITE
36 | mulBasis(rBasisRot, rBasisPos.xyz + aCoord.xyz, vec3(aTexCoord.z, aTexCoord.w, 0.0) * 32767.0);
37 | #else
38 | mulBasis(rBasisRot, rBasisPos.xyz, aCoord.xyz);
39 | #endif
40 |
41 | vDiffuse.xyz = aColor.xyz * aLight.xyz * uMaterial.xyz;
42 | float fog = length(uViewPos.xyz - coord.xyz) * uFogParams.w;
43 | vDiffuse.w = clamp(1.0 / exp(fog), 0.0, 1.0);
44 |
45 | gl_Position = uViewProj * vec4(coord, 1.0);
46 | }
47 |
48 | #else
49 |
50 | uniform sampler2D sDiffuse;
51 |
52 | void main() {
53 | vec4 color = texture2D(sDiffuse, vTexCoord);
54 |
55 | #ifdef ALPHA_TEST
56 | if (color.w <= 0.5)
57 | discard;
58 | #endif
59 |
60 | color.xyz *= vDiffuse.xyz;
61 | color.xyz = mix(uFogParams.xyz, color.xyz, vDiffuse.w);
62 |
63 | color.xyz *= color.w;
64 |
65 | fragColor = color;
66 | }
67 |
68 | #endif
69 | )===="
70 |
--------------------------------------------------------------------------------
/src/shaders/ambient_room.asm:
--------------------------------------------------------------------------------
1 | #include "common.asm"
2 |
3 | #ifdef VERTEX
4 | ; variables
5 | #define lv1 r1
6 | #define lv2 r2
7 | #define lv3 r3
8 | #define normal r4
9 | #define att r5
10 | #define light r6
11 | #define pos r7
12 |
13 | ; pos = mulQuatPos(uBasis[0], aCoord)
14 | mulQuatPos(pos, aCoord, 0)
15 |
16 | ; vFog = length((uViewPos - pos) * uFogParams.w)
17 | applyFog(vFog, pos)
18 |
19 | ; vPosition = uViewProj * pos
20 | mulMat(vPosition, pos, uViewProj)
21 |
22 | ; lighting
23 | ; lv[1..3] = (uLightPos[1..3].xyz - pos) * uLightColor[1..3].w;
24 | add lv1.xyz, c[uLightPos + 1], -pos
25 | add lv2.xyz, c[uLightPos + 2], -pos
26 | add lv3.xyz, c[uLightPos + 3], -pos
27 | mul lv1.xyz, c[uLightColor + 1].w, lv1
28 | mul lv2.xyz, c[uLightColor + 2].w, lv2
29 | mul lv3.xyz, c[uLightColor + 3].w, lv3
30 |
31 | ; att[1..3] = dot(lv[1..3], lv[1..3])
32 | mov att.x, ONE
33 | dp3 att.y, lv1, lv1
34 | dp3 att.z, lv2, lv2
35 | dp3 att.w, lv3, lv3
36 |
37 | ; att = max(0, 1 - att) / sqrt(att)
38 | rsq tmp.y, att.y
39 | rsq tmp.z, att.z
40 | rsq tmp.w, att.w
41 |
42 | add att, ONE, -att
43 | max att, ZERO, att
44 | mul att, tmp, att
45 |
46 | ; light = max(0, dot(aNormal, lv[1..3]))
47 | mov light.x, ZERO
48 | dp3 light.y, lv1, aNormal
49 | dp3 light.z, lv2, aNormal
50 | dp3 light.w, lv3, aNormal
51 |
52 | ; light = max(0, light) * att
53 | max light, ZERO, light
54 | mul light, light, att
55 |
56 | ; vColor = (aLight + light[1..3] * uLightColor[1..3]) * aColor * 2
57 | mov att, aColor
58 | mov tmp, aLight
59 | mad tmp.xyz, light.y, c[uLightColor + 1], tmp
60 | mad tmp.xyz, light.z, c[uLightColor + 2], tmp
61 | mad tmp.xyz, light.w, c[uLightColor + 3], tmp
62 | mul att, att, tmp
63 | applyUnderwater(tmp, pos)
64 | add vColor, tmp, tmp
65 |
66 | ; vTecCoord = (aTexCoord.xyz, 1)
67 | mov vTexCoord, aTexCoord
68 | mov vTexCoord.w, ONE
69 | #else
70 | tex t0
71 | mul r0, t0, vColor
72 | #endif
--------------------------------------------------------------------------------
/src/shaders/ambient_room.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | float4 texCoord : TEXCOORD0;
6 | float4 diffuse : COLOR0;
7 | };
8 |
9 | #ifdef VERTEX
10 |
11 | VS_OUTPUT main(VS_INPUT In) {
12 | VS_OUTPUT Out;
13 |
14 | float4 rBasisRot = uBasis[0];
15 | float4 rBasisPos = uBasis[1];
16 |
17 | Out.texCoord = In.aTexCoord * INV_SHORT_HALF;
18 |
19 | float3 coord;
20 |
21 | coord = mulBasis(rBasisRot, rBasisPos.xyz, In.aCoord.xyz);
22 |
23 | Out.diffuse = float4(In.aColor.rgb * (uMaterial.x * 1.8), 1.0);
24 | Out.diffuse.xyz *= In.aLight.rgb;
25 |
26 | Out.diffuse *= uMaterial.w;
27 |
28 | Out.pos = mul(uViewProj, float4(coord, 1.0));
29 |
30 | return Out;
31 | }
32 |
33 | #else // PIXEL
34 |
35 | float4 main(VS_OUTPUT In) : COLOR0 {
36 | float4 color = SAMPLE_2D(sDiffuse, In.texCoord.xy);
37 |
38 | #ifdef ALPHA_TEST
39 | clip(color.w - ALPHA_REF);
40 | #endif
41 |
42 | color *= In.diffuse;
43 |
44 | return color;
45 | }
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/src/shaders/ambient_sprite.asm:
--------------------------------------------------------------------------------
1 | #include "common.asm"
2 |
3 | #ifdef VERTEX
4 | m4x4 oPos, aCoord, c[uViewProj]
5 | mov oD0, aLight
6 | mov oT0, aTexCoord
7 | #else
8 | tex t0
9 | mov r0, t0
10 | #endif
--------------------------------------------------------------------------------
/src/shaders/ambient_sprite.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | float4 texCoord : TEXCOORD0;
6 | float4 diffuse : COLOR0;
7 | };
8 |
9 | #ifdef VERTEX
10 |
11 | VS_OUTPUT main(VS_INPUT In) {
12 | VS_OUTPUT Out;
13 |
14 | float4 rBasisRot = uBasis[0];
15 | float4 rBasisPos = uBasis[1];
16 |
17 | Out.texCoord = In.aTexCoord * INV_SHORT_HALF;
18 |
19 | float3 coord;
20 |
21 | coord = mulBasis(rBasisRot, rBasisPos.xyz + In.aCoord.xyz, float3(In.aTexCoord.z, In.aTexCoord.w, 0.0));
22 |
23 | Out.diffuse = float4(In.aColor.rgb * (uMaterial.x * 1.8), 1.0);
24 | Out.diffuse.xyz *= In.aLight.rgb;
25 |
26 | Out.diffuse *= uMaterial.w;
27 |
28 | Out.diffuse *= In.aLight.a;
29 |
30 | Out.pos = mul(uViewProj, float4(coord, 1.0));
31 |
32 | return Out;
33 | }
34 |
35 | #else // PIXEL
36 |
37 | float4 main(VS_OUTPUT In) : COLOR0 {
38 | float4 color = SAMPLE_2D(sDiffuse, In.texCoord.xy);
39 |
40 | #ifdef ALPHA_TEST
41 | clip(color.w - ALPHA_REF);
42 | #endif
43 |
44 | color *= In.diffuse;
45 |
46 | return color;
47 | }
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/src/shaders/clear.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | #ifdef VERTEX
4 |
5 | float4 main(VS_INPUT In) : POSITION {
6 | return In.aCoord;
7 | }
8 |
9 | #else // PIXEL
10 |
11 | float4 main() : COLOR {
12 | return uMaterial;
13 | }
14 |
15 | #endif
--------------------------------------------------------------------------------
/src/shaders/compile_d3d11.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | rd /S /Q d3d11
3 | mkdir d3d11
4 |
5 | call :compile_au compose_sprite
6 | call :compile_au compose_room
7 | call :compile_au compose_entity
8 | call :compile compose_mirror
9 | call :compile compose_flash
10 |
11 | call :compile_a shadow_entity
12 | call :compile_a ambient_room
13 | call :compile_a ambient_sprite
14 |
15 | call :compile water_drop
16 | call :compile water_simulate
17 | call :compile water_caustics
18 | call :compile water_rays
19 | call :compile water_mask
20 | call :compile water_compose
21 |
22 | call :compile filter _upscale "/DUPSCALE"
23 | call :compile filter _downsample "/DDOWNSAMPLE"
24 | call :compile filter _grayscale "/DGRAYSCALE"
25 | call :compile filter _blur "/DBLUR"
26 | call :compile filter _anaglyph "/DANAGLYPH"
27 |
28 | call :compile sky
29 | call :compile sky _clouds "/DSKY_CLOUDS"
30 | call :compile sky _azure "/DSKY_AZURE"
31 |
32 | call :compile gui
33 |
34 |
35 | EXIT /B %ERRORLEVEL%
36 |
37 | :compile
38 | SETLOCAL
39 | echo compile d3d11/%~1%~2 %~3
40 | echo #include "%~1%~2_v.h" >> d3d11/shaders.h
41 | echo #include "%~1%~2_f.h" >> d3d11/shaders.h
42 | fxc /nologo /T vs_4_0 /O3 /Gec /D_GAPI_D3D11=1 /Vn %~1%~2_v /Fh d3d11/%~1%~2_v.h %~1.hlsl /DVERTEX %~3
43 | fxc /nologo /T ps_4_0 /O3 /Gec /D_GAPI_D3D11=1 /Vn %~1%~2_f /Fh d3d11/%~1%~2_f.h %~1.hlsl /DPIXEL %~3
44 | ENDLOCAL
45 | EXIT /B 0
46 |
47 | :compile_a
48 | SETLOCAL
49 | call :compile %~1
50 | call :compile %~1 _a "/DALPHA_TEST"
51 | ENDLOCAL
52 | EXIT /B 0
53 |
54 | :compile_au
55 | SETLOCAL
56 | call :compile_a %~1
57 | call :compile %~1 _u "/DUNDERWATER"
58 | call :compile %~1 _au "/DALPHA_TEST /DUNDERWATER"
59 | ENDLOCAL
60 | EXIT /B 0
61 |
--------------------------------------------------------------------------------
/src/shaders/compile_d3d8.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | rd /S /Q d3d8
3 | mkdir d3d8
4 |
5 | call :compile_u compose_sprite
6 | call :compile_u compose_room
7 | call :compile_u compose_entity
8 | call :compile compose_mirror
9 | call :compile compose_flash
10 |
11 | call :compile shadow_entity
12 | call :compile ambient_room
13 | call :compile ambient_sprite
14 |
15 | call :compile filter _upscale "/D UPSCALE"
16 | call :compile filter _downsample "/D DOWNSAMPLE"
17 | call :compile filter _grayscale "/D GRAYSCALE"
18 | call :compile filter _blur "/D BLUR"
19 | call :compile filter _anaglyph "/D ANAGLYPH"
20 |
21 | call :compile gui
22 |
23 | del tmp
24 |
25 | EXIT /B %ERRORLEVEL%
26 |
27 | :compile
28 | SETLOCAL
29 | echo compile d3d8/%~1%~2 %~3
30 | echo #include "%~1%~2_v.h" >> d3d8/shaders.h
31 | echo #include "%~1%~2_f.h" >> d3d8/shaders.h
32 | xsasm /D VERTEX /O2 %~3 %~1.asm tmp
33 | bin2c -n %~1%~2_v -o d3d8/%~1%~2_v.h tmp
34 | xsasm /D PIXEL /O2 %~3 %~1.asm tmp
35 | bin2c -n %~1%~2_f -o d3d8/%~1%~2_f.h tmp
36 | ENDLOCAL
37 | EXIT /B 0
38 |
39 | :compile_u
40 | SETLOCAL
41 | call :compile %~1
42 | call :compile %~1 _u "/D UNDERWATER"
43 | ENDLOCAL
44 | EXIT /B 0
45 |
--------------------------------------------------------------------------------
/src/shaders/compile_d3d9.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | rd /S /Q d3d9
3 | mkdir d3d9
4 |
5 | call :compile_au compose_sprite
6 | call :compile_au compose_room
7 | call :compile_au compose_entity
8 | call :compile compose_mirror
9 | call :compile compose_flash
10 |
11 | call :compile_a shadow_entity
12 | call :compile_a ambient_room
13 | call :compile_a ambient_sprite
14 |
15 | call :compile water_drop
16 | call :compile water_simulate
17 | call :compile water_caustics
18 | call :compile water_rays
19 | call :compile water_mask
20 | call :compile water_compose
21 |
22 | call :compile filter _upscale "/DUPSCALE"
23 | call :compile filter _downsample "/DDOWNSAMPLE"
24 | call :compile filter _grayscale "/DGRAYSCALE"
25 | call :compile filter _blur "/DBLUR"
26 | call :compile filter _anaglyph "/DANAGLYPH"
27 |
28 | call :compile gui
29 |
30 |
31 | EXIT /B %ERRORLEVEL%
32 |
33 | :compile
34 | SETLOCAL
35 | echo compile d3d9/%~1%~2 %~3
36 | echo #include "%~1%~2_v.h" >> d3d9/shaders.h
37 | echo #include "%~1%~2_f.h" >> d3d9/shaders.h
38 | fxc /nologo /T vs_3_0 /O3 /Gec /D_GAPI_D3D9=1 /Vn %~1%~2_v /Fh d3d9/%~1%~2_v.h %~1.hlsl /DVERTEX %~3
39 | fxc /nologo /T ps_3_0 /O3 /Gec /D_GAPI_D3D9=1 /Vn %~1%~2_f /Fh d3d9/%~1%~2_f.h %~1.hlsl /DPIXEL %~3
40 | ENDLOCAL
41 | EXIT /B 0
42 |
43 | :compile_a
44 | SETLOCAL
45 | call :compile %~1
46 | call :compile %~1 _a "/DALPHA_TEST"
47 | ENDLOCAL
48 | EXIT /B 0
49 |
50 | :compile_au
51 | SETLOCAL
52 | call :compile_a %~1
53 | call :compile %~1 _u "/DUNDERWATER"
54 | call :compile %~1 _au "/DALPHA_TEST /DUNDERWATER"
55 | ENDLOCAL
56 | EXIT /B 0
57 |
--------------------------------------------------------------------------------
/src/shaders/compile_gxm.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | rd /S /Q gxm
3 | mkdir gxm
4 |
5 | call :compile_au compose_sprite
6 | call :compile_au compose_room
7 | call :compile_au compose_entity
8 | call :compile compose_mirror
9 | call :compile compose_flash
10 |
11 | call :compile_a shadow_entity
12 | call :compile_a ambient_room
13 | call :compile_a ambient_sprite
14 |
15 | call :compile water_drop
16 | call :compile water_simulate
17 | call :compile water_caustics
18 | call :compile water_rays
19 | call :compile water_mask
20 | call :compile water_compose
21 |
22 | call :compile filter _upscale "-DUPSCALE"
23 | call :compile filter _downsample "-DDOWNSAMPLE"
24 | call :compile filter _grayscale "-DGRAYSCALE"
25 | call :compile filter _blur "-DBLUR"
26 |
27 | call :compile gui
28 |
29 | call :compile clear
30 |
31 | cd gxm
32 | set CONV_CMD=..\bin2c.exe
33 |
34 | for /r . %%i in (*.gxp) do (
35 | :: ..\psp2gxpstrip -o %%i %%i
36 | ..\bin2c.exe %%i %%~ni.h %%~ni
37 | )
38 |
39 | cd ..
40 |
41 | EXIT /B %ERRORLEVEL%
42 |
43 | :compile
44 | SETLOCAL
45 | echo compile gxm/%~1%~2 %~3
46 | echo #include "%~1%~2_v.h" >> gxm/shaders.h
47 | echo #include "%~1%~2_f.h" >> gxm/shaders.h
48 | psp2cgc -profile sce_vp_psp2 -W4 -Wperf -D_GAPI_GXM=1 -pedantic %~1.hlsl -cache -o gxm/%~1%~2_v.gxp %~3 -DVERTEX
49 | psp2cgc -profile sce_fp_psp2 -W4 -Wperf -D_GAPI_GXM=1 -pedantic %~1.hlsl -cache -o gxm/%~1%~2_f.gxp %~3 -DPIXEL
50 | ENDLOCAL
51 | EXIT /B 0
52 |
53 | :compile_a
54 | SETLOCAL
55 | call :compile %~1
56 | call :compile %~1 _a "-DALPHA_TEST"
57 | ENDLOCAL
58 | EXIT /B 0
59 |
60 | :compile_au
61 | SETLOCAL
62 | call :compile_a %~1
63 | call :compile %~1 _u "-DUNDERWATER"
64 | call :compile %~1 _au "-DALPHA_TEST -DUNDERWATER"
65 | ENDLOCAL
66 | EXIT /B 0
67 |
--------------------------------------------------------------------------------
/src/shaders/compose_flash.asm:
--------------------------------------------------------------------------------
1 | #include "common.asm"
2 |
3 | #ifdef VERTEX
4 | ; variables
5 | #define lv0 r0
6 | #define lv1 r1
7 | #define lv2 r2
8 | #define lv3 r3
9 | #define normal r4
10 | #define att r5
11 | #define light r6
12 | #define pos r7
13 | #define MAT_DIFFUSE c[uMaterial].x
14 | #define MAT_EMISSIVE c[uMaterial].w
15 |
16 | ; pos = mulQuatPos(uBasis[0], aCoord)
17 | mulQuatPos(pos, aCoord, 0)
18 |
19 | ; vFog = length((uViewPos - pos) * uFogParams.w)
20 | applyFog(vFog, pos)
21 |
22 | ; vPosition = uViewProj * pos
23 | mulMat(vPosition, pos, uViewProj)
24 |
25 | ; vColor = (material.diffuse * aColor.xyz * 2.0 + material.emissive, 1.0)
26 | mul tmp, MAT_DIFFUSE, aColor
27 | add tmp, tmp, tmp
28 | add tmp, tmp, MAT_EMISSIVE
29 | mov tmp.w, MAT_EMISSIVE
30 | mul tmp, tmp, HALF
31 | encodeColor(tmp)
32 |
33 | ; vTecCoord = (aTexCoord.xyz, 1)
34 | mov vTexCoord, aTexCoord
35 | mov vTexCoord.w, ONE
36 | #else
37 | tex t0
38 | applyColor(r0, t0)
39 | #endif
--------------------------------------------------------------------------------
/src/shaders/compose_flash.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | float4 texCoord : TEXCOORD0;
6 | float3 diffuse : TEXCOORD1;
7 | };
8 |
9 | #ifdef VERTEX
10 |
11 | VS_OUTPUT main(VS_INPUT In) {
12 | VS_OUTPUT Out;
13 |
14 | int index = int(In.aCoord.w);
15 | float4 rBasisRot = uBasis[index];
16 | float4 rBasisPos = uBasis[index + 1];
17 |
18 | float3 coord = mulBasis(rBasisRot, rBasisPos.xyz, In.aCoord.xyz);
19 |
20 | Out.pos = mul(uViewProj, float4(coord, 1.0));
21 | Out.diffuse = In.aColor.rgb * (uMaterial.x * 1.8) + uMaterial.w;
22 | Out.texCoord = In.aTexCoord * INV_SHORT_HALF;
23 | Out.texCoord.xy *= Out.texCoord.zw;
24 |
25 | return Out;
26 | }
27 |
28 | #else // PIXEL
29 |
30 | float4 main(VS_OUTPUT In) : COLOR0 {
31 | float4 color = SAMPLE_2D(sDiffuse, In.texCoord.xy / In.texCoord.zw);
32 |
33 | color.xyz *= In.diffuse.xyz;
34 | return color;
35 | }
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/src/shaders/compose_mirror.asm:
--------------------------------------------------------------------------------
1 | #include "common.asm"
2 |
3 | #ifdef VERTEX
4 | ; variables
5 | #define lv0 r0
6 | #define lv1 r1
7 | #define lv2 r2
8 | #define lv3 r3
9 | #define normal r4
10 | #define tmp2 r5
11 | #define viewVec r6
12 | #define pos r7
13 |
14 | ; joint = int(aCoord.w)
15 | mov a0.x, aCoord.w
16 |
17 | ; pos = mulQuatPos(uBasis[joint], aCoord)
18 | mulQuatPos(pos, aCoord, a0.x)
19 |
20 | ; vFog = length((uViewPos - pos) * uFogParams.w)
21 | applyFog(vFog, pos)
22 |
23 | ; vPosition = uViewProj * pos
24 | mulMat(vPosition, pos, uViewProj)
25 |
26 | ; viewVec = normalize(pos - uViewPos)
27 | sub viewVec, pos, c[uViewPos]
28 | normalize(viewVec)
29 |
30 | ; normal = mulQuat(uBasis, aNormal)
31 | mulQuat(normal, aNormal, a0.x)
32 |
33 | ; vTexCoord = reflect(viewVec, normal)
34 | reflect(vTexCoord, viewVec, normal)
35 |
36 | ; vColor = uMaterial
37 | mov tmp, c[uMaterial]
38 | mul tmp, tmp, HALF
39 | encodeColor(tmp)
40 | #else
41 | tex t0
42 | applyColor(r0, t0)
43 | #endif
--------------------------------------------------------------------------------
/src/shaders/compose_mirror.hlsl:
--------------------------------------------------------------------------------
1 | #define DIFFUSE_AS_CUBE
2 | #include "common.hlsl"
3 |
4 | struct VS_OUTPUT {
5 | float4 pos : POSITION;
6 | float4 viewVec : TEXCOORD0;
7 | float4 normal : TEXCOORD1;
8 | };
9 |
10 | #ifdef VERTEX
11 |
12 | VS_OUTPUT main(VS_INPUT In) {
13 | VS_OUTPUT Out;
14 |
15 | int index = int(In.aCoord.w);
16 | float4 rBasisRot = uBasis[index];
17 | float4 rBasisPos = uBasis[index + 1];
18 |
19 | float3 coord = mulBasis(rBasisRot, rBasisPos.xyz, In.aCoord.xyz);
20 |
21 | Out.viewVec = float4((uViewPos.xyz - coord) * uFogParams.w, uParam.w - coord.y * uParam.z);
22 |
23 | Out.normal.xyz = mulQuat(rBasisRot, normalize(In.aNormal.xyz));
24 | Out.normal.w = saturate(1.0 / exp(length(Out.viewVec.xyz)));
25 |
26 | Out.pos = mul(uViewProj, float4(coord, rBasisPos.w));
27 |
28 | return Out;
29 | }
30 |
31 | #else // PIXEL
32 |
33 | float4 main(VS_OUTPUT In) : COLOR0 {
34 | float3 rv = reflect(-In.viewVec.xyz, In.normal.xyz);
35 | float4 color = SAMPLE_CUBE(sDiffuse, normalize(rv));
36 |
37 | color *= uMaterial;
38 | color.xyz = saturate(color.xyz);
39 |
40 | applyFog(color.xyz, In.normal.w);
41 |
42 | return color;
43 | }
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/src/shaders/compose_room.asm:
--------------------------------------------------------------------------------
1 | #include "common.asm"
2 |
3 | #ifdef VERTEX
4 | ; variables
5 | #define lv1 r1
6 | #define lv2 r2
7 | #define lv3 r3
8 | #define normal r4
9 | #define att r5
10 | #define light r6
11 | #define pos r7
12 |
13 | ; pos = mulQuatPos(uBasis[0], aCoord)
14 | mulQuatPos(pos, aCoord, 0)
15 |
16 | ; vFog = length((uViewPos - pos) * uFogParams.w)
17 | applyFog(vFog, pos)
18 |
19 | ; vPosition = uViewProj * pos
20 | mulMat(vPosition, pos, uViewProj)
21 |
22 | ; lighting
23 | ; lv[1..3] = (uLightPos[1..3].xyz - pos) * uLightColor[1..3].w;
24 | add lv1.xyz, c[uLightPos + 1], -pos
25 | add lv2.xyz, c[uLightPos + 2], -pos
26 | add lv3.xyz, c[uLightPos + 3], -pos
27 | mul lv1.xyz, c[uLightColor + 1].w, lv1
28 | mul lv2.xyz, c[uLightColor + 2].w, lv2
29 | mul lv3.xyz, c[uLightColor + 3].w, lv3
30 |
31 | ; att[1..3] = dot(lv[1..3], lv[1..3])
32 | mov att.x, ONE
33 | dp3 att.y, lv1, lv1
34 | dp3 att.z, lv2, lv2
35 | dp3 att.w, lv3, lv3
36 |
37 | ; att = max(0, 1 - att) / sqrt(att)
38 | rsq tmp.y, att.y
39 | rsq tmp.z, att.z
40 | rsq tmp.w, att.w
41 |
42 | add att, ONE, -att
43 | max att, ZERO, att
44 | mul att, tmp, att
45 |
46 | ; light = max(0, dot(aNormal, lv[1..3]))
47 | mov light.x, ZERO
48 | dp3 light.y, lv1, aNormal
49 | dp3 light.z, lv2, aNormal
50 | dp3 light.w, lv3, aNormal
51 |
52 | ; light = max(0, light) * att
53 | max light, ZERO, light
54 | mul light, light, att
55 |
56 | ; vColor = (aLight + light[1..3] * uLightColor[1..3]) * aColor * 2
57 | mov att, aColor
58 | mov tmp, aLight
59 | mad tmp.xyz, light.y, c[uLightColor + 1], tmp
60 | mad tmp.xyz, light.z, c[uLightColor + 2], tmp
61 | mad tmp.xyz, light.w, c[uLightColor + 3], tmp
62 | mul att, att, tmp
63 | applyUnderwater(att, pos)
64 | encodeColor(att)
65 |
66 | ; vTecCoord = (aTexCoord.xyz, 1)
67 | mov vTexCoord, aTexCoord
68 | mov vTexCoord.w, ONE
69 | #else
70 | tex t0
71 | applyColor(r0, t0)
72 | #endif
--------------------------------------------------------------------------------
/src/shaders/dummy.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | };
6 |
7 | #ifdef VERTEX
8 | VS_OUTPUT main(VS_INPUT In) {
9 | VS_OUTPUT Out;
10 | Out.pos = 0.0;
11 | return Out;
12 | }
13 |
14 | #else // PIXEL
15 |
16 | float4 main(VS_OUTPUT In) : COLOR0 {
17 | return float4(1.0, 0.0, 1.0, 0.0);
18 | }
19 | #endif
--------------------------------------------------------------------------------
/src/shaders/filter.asm:
--------------------------------------------------------------------------------
1 | #include "common.asm"
2 |
3 | #ifdef VERTEX
4 | mulMat(vPosition, aCoord, uViewProj)
5 |
6 |
7 | #ifdef GRAYSCALE
8 | mov vColor.xyz, c[uParam].xyz
9 | mov vColor.w, ONE
10 | #else
11 | mov vColor, aLight
12 | #endif
13 |
14 | ; vTecCoord = (aTexCoord.xyz, 1)
15 | #ifdef UPSCALE
16 | mov vTexCoord, aTexCoord ; TODO + 0.5 * (1 / uParam.xy)
17 | #endif
18 |
19 | #ifdef DOWNSAMPLE
20 | mov vTexCoord, aTexCoord
21 | #endif
22 |
23 | #ifdef GRAYSCALE
24 | mov tmp, c[uParam].wwww
25 | mad vTexCoord, tmp, HALF, aTexCoord
26 | #endif
27 |
28 | #ifdef BLUR
29 | mov tmp, c[uParam].wwww
30 | mad vTexCoord, tmp, HALF, aTexCoord
31 | #endif
32 |
33 | #ifdef ANAGLYPH
34 | mov vTexCoord, aTexCoord
35 | #endif
36 |
37 | mov vTexCoord.w, ONE
38 | #else
39 | def c0, 0.299f, 0.587f, 0.114f, 0.0f
40 |
41 | tex t0
42 |
43 | #ifdef UPSCALE
44 | mul r0, t0, vColor
45 | #endif
46 |
47 | #ifdef DOWNSAMPLE
48 | mul r0, t0, vColor
49 | #endif
50 |
51 | #ifdef GRAYSCALE
52 | dp3 r1.rgb, t0, c0
53 | mov r0, vColor
54 | mul r0.rgb, r0.rgb, r1.rgb
55 | #endif
56 |
57 | #ifdef BLUR ; TODO four tap blur
58 | mul r0, t0, vColor
59 | #endif
60 |
61 | #ifdef ANAGLYPH
62 | mul r0, t0, vColor
63 | #endif
64 |
65 | #endif
--------------------------------------------------------------------------------
/src/shaders/gui.asm:
--------------------------------------------------------------------------------
1 | #include "common.asm"
2 |
3 | #ifdef VERTEX
4 | mulMat(vPosition, aCoord, uViewProj)
5 |
6 | mul vColor, aLight, c[uMaterial]
7 |
8 | ; vTecCoord = (aTexCoord.xyz, 1)
9 | mov vTexCoord, aTexCoord
10 | mov vTexCoord.w, ONE
11 | #else
12 | tex t0
13 | mul r0, t0, vColor
14 | #endif
--------------------------------------------------------------------------------
/src/shaders/gui.glsl:
--------------------------------------------------------------------------------
1 | R"====(
2 | varying vec2 vTexCoord;
3 | varying vec4 vColor;
4 |
5 | #ifdef VERTEX
6 | uniform mat4 uViewProj;
7 | uniform vec4 uMaterial;
8 |
9 | attribute vec4 aCoord;
10 | attribute vec4 aTexCoord;
11 | attribute vec4 aLight;
12 |
13 | void main() {
14 | vTexCoord = aTexCoord.xy;
15 | vColor = aLight * uMaterial;
16 | gl_Position = uViewProj * aCoord;
17 | }
18 | #else
19 | uniform sampler2D sDiffuse;
20 |
21 | void main() {
22 | fragColor = texture2D(sDiffuse, vTexCoord) * vColor;
23 | }
24 | #endif
25 | )===="
26 |
--------------------------------------------------------------------------------
/src/shaders/gui.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | float2 texCoord : TEXCOORD0;
6 | float4 diffuse : COLOR0;
7 | };
8 |
9 | #ifdef VERTEX
10 | VS_OUTPUT main(VS_INPUT In) {
11 | VS_OUTPUT Out;
12 | Out.pos = mul(uViewProj, float4(In.aCoord.xy, 0.0, 1.0));
13 | Out.texCoord = In.aTexCoord.xy * INV_SHORT_HALF;
14 | Out.diffuse = In.aLight * uMaterial;
15 | return Out;
16 | }
17 |
18 | #else // PIXEL
19 |
20 | float4 main(VS_OUTPUT In) : COLOR0 {
21 | return In.diffuse * SAMPLE_2D_LINEAR(sDiffuse, In.texCoord);
22 | }
23 | #endif
--------------------------------------------------------------------------------
/src/shaders/pica/ambient_room.v.pica:
--------------------------------------------------------------------------------
1 | ; constants
2 | .constf const0(0.0, 0.5, 1.0, 2.0)
3 | .constf const1(0.00392156886, 3.05185094e-005, 0.00001, 0.00787401574)
4 |
5 | .alias ZERO const0.x
6 | .alias HALF const0.y
7 | .alias ONE const0.z
8 | .alias TWO const0.w
9 | .alias INV_BYTE const1.x
10 | .alias INV_SHORT const1.y
11 | .alias EPS const1.z
12 | .alias INV_127 const1.w
13 |
14 | ; uniforms
15 | .fvec uViewProj[4]
16 | .fvec uBasis[2]
17 | .fvec uLightPos[4]
18 | .fvec uLightColor[4]
19 |
20 | ; in
21 | .alias aCoord v0
22 | .alias aNormal v1
23 | .alias aTexCoord v2
24 | .alias aColor v3
25 | .alias aLight v4
26 |
27 | ; variables
28 | .alias lv1 r1
29 | .alias lv2 r2
30 | .alias lv3 r3
31 | .alias normal r4
32 | .alias att r5
33 | .alias light r6
34 | .alias pos r7
35 | .alias tmp r8
36 |
37 | ; out
38 | .out vPosition position
39 | .out vTexCoord texcoord0
40 | .out vColor color
41 |
42 | .proc main
43 | ; pos = mulQuatPos(uBasis, aCoord)
44 | mul pos.xyz, uBasis[0], aCoord.zxyw
45 | mad pos.xyz, aCoord, uBasis[0].zxyw, -pos
46 | mad pos.xyz, aCoord.yzxw, uBasis[0].w, pos
47 | mul tmp.xyz, uBasis[0].zxyw, pos
48 | mad pos.xyz, pos.yzxw, uBasis[0].yzxw, -tmp
49 | mad pos.xyz, pos, TWO, aCoord
50 | add pos.xyz, uBasis[1], pos
51 | mov pos.w, ONE
52 |
53 | ; vPosition = uViewProj * pos
54 | mul tmp, uViewProj[0], pos.x
55 | mad tmp, pos.y, uViewProj[1], tmp
56 | mad tmp, pos.z, uViewProj[2], tmp
57 | mad vPosition, pos.w, uViewProj[3], tmp
58 |
59 | ; vColor = aColor/255 * aLight/255
60 | mul tmp, INV_BYTE, aColor
61 | mul att, INV_BYTE, aLight
62 | mul vColor, tmp, att
63 |
64 | ; vTecCoord = aTexCoord/32767
65 | mul vTexCoord, INV_SHORT, aTexCoord
66 |
67 | end
68 | .end
69 |
--------------------------------------------------------------------------------
/src/shaders/pica/ambient_sprite.v.pica:
--------------------------------------------------------------------------------
1 | ; constants
2 | .constf const0(0.0, 0.5, 1.0, 2.0)
3 | .constf const1(0.00392156886, 3.05185094e-005, 0.00001, 0.00787401574)
4 |
5 | .alias ZERO const0.x
6 | .alias HALF const0.y
7 | .alias ONE const0.z
8 | .alias TWO const0.w
9 | .alias INV_BYTE const1.x
10 | .alias INV_SHORT const1.y
11 | .alias EPS const1.z
12 | .alias INV_127 const1.w
13 |
14 | ; uniforms
15 | .fvec uViewPos
16 | .fvec uViewProj[4]
17 | .fvec uBasis[2]
18 | .fvec uLightPos[4]
19 | .fvec uLightColor[4]
20 | .fvec uMaterial
21 | .alias MAT_AMBIENT uMaterial.y
22 | .alias MAT_ALPHA uMaterial.w
23 |
24 | ; in
25 | .alias aCoord v0
26 | .alias aNormal v1
27 | .alias aTexCoord v2
28 | .alias aColor v3
29 | .alias aLight v4
30 |
31 | ; variables
32 | .alias lv0 r0
33 | .alias lv1 r1
34 | .alias lv2 r2
35 | .alias lv3 r3
36 | .alias normal r4
37 | .alias att r5
38 | .alias light r6
39 | .alias pos r7
40 | .alias tmp r8
41 | .alias size r4
42 | .alias vv r6
43 |
44 | ; out
45 | .out vPosition position
46 | .out vTexCoord texcoord0
47 | .out vColor color
48 |
49 | .proc main
50 | ; pos = aCoord + mulQuatPos(uBasis, aTexCoord.zw)
51 | mov pos.z, ZERO
52 | mov pos.xy, aTexCoord.zw
53 | mul size.xyz, uBasis[0], pos.zxy
54 | mad size.xyz, pos.xyz, uBasis[0].zxy, -size
55 | mad size.xyz, pos.yzx, uBasis[0].w, size
56 | mul tmp.xyz, uBasis[0].zxy, size.xyz
57 | mad size.xyz, size.yzx, uBasis[0].yzx, -tmp
58 | mad pos.xyz, size, TWO, pos
59 | add size.xyz, uBasis[1], aCoord
60 | add pos.xyz, pos, size
61 | mov pos.w, ONE
62 |
63 | ; vPosition = uViewProj * pos
64 | mul tmp, uViewProj[0], pos.x
65 | mad tmp, pos.y, uViewProj[1], tmp
66 | mad tmp, pos.z, uViewProj[2], tmp
67 | mad vPosition, pos.w, uViewProj[3], tmp
68 |
69 | ; vColor = premultAlpha(aLight / 255)
70 | mul tmp, INV_BYTE, aLight
71 | mul tmp.xyz, tmp, tmp.w
72 | mov vColor, tmp
73 |
74 | ; vTecCoord = aTexCoord/32767
75 | mul vTexCoord, INV_SHORT, aTexCoord
76 |
77 | end
78 | .end
79 |
--------------------------------------------------------------------------------
/src/shaders/pica/compose_flash.v.pica:
--------------------------------------------------------------------------------
1 | ; constants
2 | .constf const0(0.0, 0.5, 1.0, 2.0)
3 | .constf const1(0.00392156886, 3.05185094e-005, 0.00001, 0.25)
4 | .alias ZERO const0.x
5 | .alias HALF const0.y
6 | .alias ONE const0.z
7 | .alias TWO const0.w
8 | .alias INV_BYTE const1.x
9 | .alias INV_SHORT const1.y
10 | .alias EPS const1.z
11 | .alias QUART const1.w
12 |
13 | ; uniforms
14 | .fvec uViewProj[4]
15 | .fvec uBasis[2]
16 | .fvec uMaterial
17 | .alias MAT_DIFFUSE uMaterial.x
18 | .alias MAT_EMISSIVE uMaterial.w
19 |
20 | ; in
21 | .alias aCoord v0
22 | .alias aNormal v1
23 | .alias aTexCoord v2
24 | .alias aColor v3
25 | .alias aLight v4
26 |
27 | ; variables
28 | .alias lv0 r0
29 | .alias lv1 r1
30 | .alias lv2 r2
31 | .alias lv3 r3
32 | .alias normal r4
33 | .alias att r5
34 | .alias light r6
35 | .alias pos r7
36 | .alias tmp r8
37 |
38 | ; out
39 | .out vPosition position
40 | .out vTexCoord texcoord0
41 | .out vColor color
42 |
43 | .proc main
44 | ; pos = mulQuatPos(uBasis, aCoord)
45 | mul pos.xyz, uBasis[0], aCoord.zxyw
46 | mad pos.xyz, aCoord, uBasis[0].zxyw, -pos
47 | mad pos.xyz, aCoord.yzxw, uBasis[0].w, pos
48 | mul tmp.xyz, uBasis[0].zxyw, pos
49 | mad pos.xyz, pos.yzxw, uBasis[0].yzxw, -tmp
50 | mad pos.xyz, pos, TWO, aCoord
51 | add pos.xyz, uBasis[1], pos
52 | mov pos.w, ONE
53 |
54 | ; vPosition = uViewProj * pos
55 | mul tmp, uViewProj[0], pos.x
56 | mad tmp, pos.y, uViewProj[1], tmp
57 | mad tmp, pos.z, uViewProj[2], tmp
58 | mad vPosition, pos.w, uViewProj[3], tmp
59 |
60 | ; vColor = aColor/255 * material.diffuse + material.emissive * 0.5
61 | mul tmp, INV_BYTE, aColor
62 | mul tmp, MAT_DIFFUSE, tmp
63 | add tmp, tmp, tmp
64 | add tmp, MAT_EMISSIVE, tmp
65 | mov tmp.w, MAT_EMISSIVE
66 | mul vColor, QUART, tmp
67 |
68 | ; vTecCoord = aTexCoord/32767
69 | mul vTexCoord, INV_SHORT, aTexCoord
70 |
71 | end
72 | .end
73 |
--------------------------------------------------------------------------------
/src/shaders/pica/dummy.v.pica:
--------------------------------------------------------------------------------
1 | ; constants
2 | .constf const0(0.0, 0.0, 0.0, 1.0)
3 |
4 | ; out
5 | .out vPosition position
6 | .out vTexCoord texcoord0
7 | .out vColor color
8 |
9 | .proc main
10 | mov vPosition, const0
11 | mov vTexCoord, const0
12 | mov vColor, const0
13 | end
14 | .end
15 |
--------------------------------------------------------------------------------
/src/shaders/pica/filter_upscale.v.pica:
--------------------------------------------------------------------------------
1 | ; constants
2 | .constf const0(3.05185094e-005, 0.00392156886, 0.0, 0.0)
3 |
4 | ; uniforms
5 | .fvec uViewProj[4]
6 |
7 | ; in
8 | .alias aCoord v0
9 | .alias aTexCoord v2
10 | .alias aLight v4
11 |
12 | ; out
13 | .out vPosition position
14 | .out vTexCoord texcoord0
15 | .out vColor color
16 |
17 | .proc main
18 | ; uViewProj * coord
19 | mov r0, uViewProj[3]
20 | mad r0, aCoord.xxxx, uViewProj[0], r0
21 | mad r0, aCoord.yyyy, uViewProj[1], r0
22 | mad vPosition, aCoord.zzzz, uViewProj[2], r0
23 |
24 | mul vTexCoord, const0.xxxx, aTexCoord
25 |
26 | mul vColor, const0.yyyy, aLight
27 |
28 | end
29 | .end
30 |
--------------------------------------------------------------------------------
/src/shaders/pica/gui.v.pica:
--------------------------------------------------------------------------------
1 | ; constants
2 | .constf const0(3.05185094e-005, 0.00392156886, 1.0, 0.0)
3 |
4 | ; uniforms
5 | .fvec uViewProj[4]
6 | .fvec uMaterial
7 |
8 | ; in
9 | .alias aCoord v0
10 | .alias aTexCoord v2
11 | .alias aLight v4
12 |
13 | ; out
14 | .out vPosition position
15 | .out vTexCoord texcoord0
16 | .out vColor color
17 |
18 | .proc main
19 | ; uViewProj * coord
20 | mov r0, uViewProj[3]
21 | mad r0, aCoord.xxxx, uViewProj[0], r0
22 | mad r0, aCoord.yyyy, uViewProj[1], r0
23 | mad vPosition, aCoord.zzzz, uViewProj[2], r0
24 |
25 | mul vTexCoord, const0.xxxx, aTexCoord
26 |
27 | mul r1, const0.yyyy, aLight
28 | mul vColor, uMaterial, r1
29 |
30 | end
31 | .end
32 |
--------------------------------------------------------------------------------
/src/shaders/pica/shadow_entity.v.pica:
--------------------------------------------------------------------------------
1 | ; constants
2 | .constf const0(2.0, 1.0, 0.5, 0.25)
3 | .constf const1(3.05185094e-005, 0.00392156886, 0.00784313725, 0.0)
4 |
5 | ; uniforms
6 | .fvec uViewProj[4]
7 | .fvec uBasis[32*2]
8 |
9 | ; in
10 | .alias aCoord v0
11 | .alias aNormal v1
12 | .alias aTexCoord v2
13 | .alias aColor v3
14 | .alias aLight v4
15 |
16 | ; out
17 | .out vPosition position
18 | .out vTexCoord texcoord0
19 | .out vColor color
20 |
21 | .proc main
22 | ; mulQuat
23 | mul r0.x, const0.xxxx, aCoord.wwww
24 |
25 | mova a0.x, r0.x
26 | mul r0.xyz, uBasis[a0.x], aCoord.zxyw
27 | mad r0.xyz, aCoord, uBasis[a0.x].zxyw, -r0
28 | mad r0.xyz, aCoord.yzxw, uBasis[a0.x].w, r0
29 | mul r1.xyz, uBasis[a0.x].zxyw, r0
30 | mad r0.xyz, r0.yzxw, uBasis[a0.x].yzxw, -r1
31 | mad r0.xyz, r0, const0.x, aCoord
32 | add r0.xyz, uBasis[a0.x + 1], r0
33 | mov r0.w, uBasis[a0.x + 1].w
34 |
35 | ; uViewProj * coord
36 | mul r1, uViewProj[0], r0.xxxx
37 | mad r1, r0.yyyy, uViewProj[1], r1
38 | mad r1, r0.zzzz, uViewProj[2], r1
39 | mad vPosition, r0.wwww, uViewProj[3], r1
40 |
41 | mul vTexCoord, const1.xxxx, aTexCoord.xyzw
42 |
43 | mul r3, const1.yyyy, aColor
44 | mul r4, const1.yyyy, aLight
45 | mul vColor, r3, r4
46 |
47 | end
48 | .end
49 |
--------------------------------------------------------------------------------
/src/shaders/shadow.glsl:
--------------------------------------------------------------------------------
1 | R"====(
2 | #ifdef ALPHA_TEST
3 | varying vec2 vTexCoord;
4 | #endif
5 |
6 | #ifdef VERTEX
7 |
8 | uniform mat4 uViewProj;
9 | uniform vec4 uBasis[32 * 2];
10 |
11 | attribute vec4 aCoord;
12 | #ifdef ALPHA_TEST
13 | attribute vec4 aTexCoord;
14 | #endif
15 |
16 | vec3 mulQuat(vec4 q, vec3 v) {
17 | return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + v * q.w);
18 | }
19 |
20 | vec3 mulBasis(vec4 rot, vec3 pos, vec3 v) {
21 | return mulQuat(rot, v) + pos;
22 | }
23 |
24 | void main() {
25 | #ifdef MESH_SKINNING
26 | int index = int(aCoord.w);
27 | vec4 rBasisRot = uBasis[index];
28 | vec4 rBasisPos = uBasis[index + 1];
29 | #else
30 | vec4 rBasisRot = uBasis[0];
31 | vec4 rBasisPos = uBasis[1];
32 | #endif
33 | #ifdef ALPHA_TEST
34 | vTexCoord = aTexCoord.xy;
35 | #endif
36 | vec3 coord = mulBasis(rBasisRot, rBasisPos.xyz, aCoord.xyz);
37 | gl_Position = uViewProj * vec4(coord, rBasisPos.w);
38 | }
39 |
40 | #else
41 |
42 | #ifdef ALPHA_TEST
43 | uniform sampler2D sDiffuse;
44 | #endif
45 |
46 | vec4 pack(float value) {
47 | vec4 v = fract(value * vec4(1.0, 255.0, 65025.0, 16581375.0));
48 | return v - v.yzww * vec4(1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);
49 | }
50 |
51 | void main() {
52 | #ifdef ALPHA_TEST
53 | if (texture2D(sDiffuse, vTexCoord).w <= 0.5)
54 | discard;
55 | #endif
56 |
57 | #ifdef SHADOW_COLOR
58 | fragColor = pack(gl_FragCoord.z);
59 | #else
60 | fragColor = vec4(1.0);
61 | #endif
62 | }
63 |
64 | #endif
65 | )===="
66 |
--------------------------------------------------------------------------------
/src/shaders/shadow_entity.asm:
--------------------------------------------------------------------------------
1 | #include "common.asm"
2 |
3 | #ifdef VERTEX
4 | ; variables
5 | #define pos r7
6 |
7 | ; joint = int(aCoord.w)
8 | mov a0.x, aCoord.w
9 |
10 | ; pos = mulQuatPos(uBasis[joint], aCoord)
11 | mulQuatPos(pos, aCoord, a0.x)
12 |
13 | ; vPosition = uViewProj * pos
14 | mulMat(vPosition, pos, uViewProj)
15 |
16 | ; vTecCoord = (aTexCoord.xyz, 1) TODO check AKILL
17 | mov vTexCoord, aTexCoord
18 | mov vTexCoord.w, ONE
19 | #else
20 | def c0, 0.0f, 0.0f, 0.0f, 1.0f
21 | mov r0, c0
22 | #endif
--------------------------------------------------------------------------------
/src/shaders/shadow_entity.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | float4 texCoord : TEXCOORD0;
6 | #ifndef SHADOW_DEPTH
7 | float4 hpos : TEXCOORD1;
8 | #endif
9 | };
10 |
11 | #ifdef VERTEX
12 |
13 | VS_OUTPUT main(VS_INPUT In) {
14 | VS_OUTPUT Out;
15 |
16 | int index = int(In.aCoord.w);
17 | float4 rBasisRot = uBasis[index];
18 | float4 rBasisPos = uBasis[index + 1];
19 |
20 | float3 cpos = In.aCoord.xyz - normalize(In.aNormal.xyz) * SHADOW_NORMAL_BIAS;
21 | float3 coord = mulBasis(rBasisRot, rBasisPos.xyz, cpos);
22 |
23 | Out.texCoord = In.aTexCoord * INV_SHORT_HALF;
24 | Out.pos = mul(uViewProj, float4(coord, rBasisPos.w));
25 | #ifndef SHADOW_DEPTH
26 | Out.hpos = Out.pos;
27 | #endif
28 | return Out;
29 | }
30 |
31 | #else // PIXEL
32 |
33 | #if defined(ALPHA_TEST) || !defined(SHADOW_DEPTH)
34 | #define PS_PARAMS VS_OUTPUT In
35 | #else
36 | #define PS_PARAMS
37 | #endif
38 |
39 | float4 main(PS_PARAMS) : COLOR0 {
40 | #ifdef ALPHA_TEST
41 | clip(SAMPLE_2D_LINEAR(sDiffuse, In.texCoord.xy).a - ALPHA_REF);
42 | #endif
43 |
44 | #ifdef SHADOW_DEPTH
45 | return 0.0;
46 | #else
47 | return pack(In.hpos.z / In.hpos.w);
48 | #endif
49 | }
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/src/shaders/water_caustics.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | float3 oldPos : TEXCOORD1;
6 | float3 newPos : TEXCOORD2;
7 | };
8 |
9 | float2 getInvUV(float2 uv, float4 param) {
10 | float2 p = (float2(uv.x, -uv.y) * 0.5 + 0.5) * param.zw;
11 |
12 | #ifdef _GAPI_D3D9
13 | p.xy += 0.5 * param.xy;
14 | #endif
15 |
16 | return p;
17 | }
18 |
19 | float2 getUV(float2 uv, float4 param) {
20 | return (uv.xy * 0.5 + 0.5) * param.zw;
21 | }
22 |
23 | #ifdef VERTEX
24 | VS_OUTPUT main(VS_INPUT In) {
25 | VS_OUTPUT Out;
26 |
27 | float3 coord = In.aCoord.xyz * INV_SHORT_HALF;
28 |
29 | float3 rCoord = float3(coord.x, coord.y, 0.0) * uPosScale[1].xzy;
30 |
31 | float2 uv = getInvUV(rCoord.xy, uTexParam).xy;
32 | float2 info = SAMPLE_2D_LOD0(sNormal, uv).xy;
33 | float3 normal = calcHeightMapNormal(float2(uv.x + uTexParam.x, uv.y), float2(uv.x, uv.y - uTexParam.y), info.x).xzy;
34 |
35 | float3 light = float3(0.0, 0.0, 1.0);
36 | float3 refOld = refract(-light, float3(0.0, 0.0, 1.0), 0.75);
37 | float3 refNew = refract(-light, normalize(normal + float3(0.0, 0.0, 0.25)), 0.75);
38 |
39 | Out.oldPos = rCoord + refOld * (-1.0 / refOld.z) + refOld * ((-refOld.z - 1.0) / refOld.z);
40 | Out.newPos = rCoord + refNew * ((info.r - 1.0) / refNew.z) + refOld * ((-refNew.z - 1.0) / refOld.z);
41 |
42 | Out.pos = float4(Out.newPos.xy + refOld.xy / refOld.z, 0.0, 1.0);
43 |
44 | return Out;
45 | }
46 |
47 | #else // PIXEL
48 |
49 | float4 main(VS_OUTPUT In) : COLOR0 {
50 | float rOldArea = length(ddx(In.oldPos)) * length(ddy(In.oldPos));
51 | float rNewArea = length(ddx(In.newPos)) * length(ddy(In.newPos));
52 | rNewArea = max(rNewArea, 0.00002); // WebGL NVIDIA workaround >_<
53 | float value = saturate(rOldArea / rNewArea * 0.2);
54 | return float4(value, 0.0, 0.0, 0.0);
55 | }
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/src/shaders/water_drop.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | float2 texCoord : TEXCOORD0;
6 | float2 dropCoord : TEXCOORD1;
7 | };
8 |
9 | float2 getInvUV(float2 uv, float4 param) {
10 | float2 p = (float2(uv.x, -uv.y) * 0.5 + 0.5) * param.zw;
11 | #ifdef _GAPI_D3D9
12 | p.xy += 0.5 * param.xy;
13 | #endif
14 | return p;
15 | }
16 |
17 | float2 getUV(float2 uv, float4 param) {
18 | float2 p = (uv.xy * 0.5 + 0.5) * param.zw;
19 | return p;
20 | }
21 |
22 | #ifdef VERTEX
23 |
24 | VS_OUTPUT main(VS_INPUT In) {
25 | VS_OUTPUT Out;
26 |
27 | float3 coord = In.aCoord.xyz * INV_SHORT_HALF;
28 |
29 | Out.pos = float4(coord.xyz, 1.0);
30 | Out.texCoord = getInvUV(coord.xy, uTexParam);
31 | Out.dropCoord = getUV(coord.xy, uTexParam);
32 |
33 | return Out;
34 | }
35 |
36 | #else // PIXEL
37 |
38 | half4 main(VS_OUTPUT In) : COLOR0 {
39 | half2 v = SAMPLE_2D_LINEAR(sNormal, In.texCoord.xy).xy;
40 |
41 | float value = max(0.0, 1.0 - length(uParam.xy - In.dropCoord / uTexParam.xy) / uParam.z);
42 | value = 0.5 - cos(value * PI) * 0.5;
43 | value *= uParam.w;
44 |
45 | v.x += (half)value;
46 | //v.x = 1.0;
47 |
48 | return half4(v, 0, 0);
49 | }
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/src/shaders/water_mask.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | #ifdef VERTEX
4 |
5 | float4 main(VS_INPUT In) : POSITION {
6 | float3 coord = In.aCoord.xyz * INV_SHORT_HALF;
7 | coord = float3(coord.x, 0.0, coord.y) * uPosScale[1].xyz + uPosScale[0].xyz;
8 | return mul(uViewProj, float4(coord, 1.0));
9 | }
10 |
11 | #else // PIXEL
12 |
13 | float4 main() : COLOR0 {
14 | return 0.0;
15 | }
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/src/shaders/water_rays.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | #define RAY_STEPS 16.0
4 |
5 | struct VS_OUTPUT {
6 | float4 pos : POSITION;
7 | float3 coord : TEXCOORD0;
8 | float3 viewVec : TEXCOORD1;
9 | };
10 |
11 | #ifdef VERTEX
12 |
13 | VS_OUTPUT main(VS_INPUT In) {
14 | VS_OUTPUT Out;
15 |
16 | Out.coord = In.aCoord.xyz + uParam.xyz;
17 | Out.viewVec = uViewPos.xyz - Out.coord.xyz;
18 | Out.pos = mul(uViewProj, float4(Out.coord, 1.0));
19 |
20 | return Out;
21 | }
22 |
23 | #else // PIXEL
24 |
25 | float boxIntersect(float3 rayPos, float3 rayDir, float3 center, float3 hsize) {
26 | center -= rayPos;
27 | float3 bMin = (center - hsize) / rayDir;
28 | float3 bMax = (center + hsize) / rayDir;
29 | float3 m = min(bMin, bMax);
30 | return max(0.0, max(m.x, max(m.y, m.z)));
31 | }
32 |
33 | #if defined(_GAPI_GXM)
34 | float4 main(VS_OUTPUT In) : COLOR0 {
35 | float2 pixelCoord = float2(__pixel_x(), __pixel_y());
36 | #else
37 | float4 main(VS_OUTPUT In) : COLOR0 {
38 | float2 pixelCoord = In.pos.xy;
39 | #endif
40 | float3 viewVec = normalize(In.viewVec);
41 |
42 | float t = boxIntersect(uViewPos.xyz, -viewVec, uPosScale[0].xyz, uPosScale[1].xyz);
43 |
44 | float3 p0 = uViewPos.xyz - viewVec * t;
45 | float3 p1 = In.coord.xyz;
46 |
47 | float dither = SAMPLE_2D_POINT_WRAP(sMask, pixelCoord * (1.0 / 8.0)).x;
48 |
49 | float3 delta = (p1 - p0) / RAY_STEPS;
50 | float3 pos = p0 + delta * dither;
51 |
52 | float sum = 0.0;
53 | for (float i = 0.0; i < RAY_STEPS; i++) {
54 | float3 wpos = (pos - uPosScale[0].xyz) / uPosScale[1].xyz;
55 | float2 tc = wpos.xz * 0.5 + 0.5;
56 | float light = SAMPLE_2D_LINEAR(sReflect, tc).x;
57 | sum += light * (1.0 - (clamp(wpos.y, -1.0, 1.0) * 0.5 + 0.5));
58 | pos += delta;
59 | }
60 | sum /= RAY_STEPS;
61 | sum *= uParam.w;
62 |
63 | return float4(UNDERWATER_COLOR * sum, 1.0);
64 | }
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/src/shaders/water_simulate.hlsl:
--------------------------------------------------------------------------------
1 | #include "common.hlsl"
2 |
3 | struct VS_OUTPUT {
4 | float4 pos : POSITION;
5 | float2 texCoord : TEXCOORD0;
6 | half2 maskCoord : TEXCOORD1;
7 | float2 texCoordL : TEXCOORD2;
8 | float2 texCoordR : TEXCOORD3;
9 | float2 texCoordT : TEXCOORD4;
10 | float2 texCoordB : TEXCOORD5;
11 | half2 noiseCoord : TEXCOORD6;
12 | };
13 |
14 | #ifdef VERTEX
15 |
16 | VS_OUTPUT main(VS_INPUT In) {
17 | VS_OUTPUT Out;
18 |
19 | float3 coord = In.aCoord.xyz * INV_SHORT_HALF;
20 | float4 uv = float4(coord.x, coord.y, coord.x, -coord.y) * 0.5 + 0.5;
21 |
22 | Out.pos = float4(coord.xyz, 1.0);
23 | Out.maskCoord = uv.xy * uRoomSize.zw;
24 | Out.texCoord = uv.zw * uTexParam.zw;
25 | #ifdef _GAPI_D3D9
26 | Out.texCoord += 0.5 * uTexParam.xy;
27 | #endif
28 |
29 | float3 d = float3(uTexParam.x, uTexParam.y, 0.0);
30 | Out.texCoordL = Out.texCoord - d.xz;
31 | Out.texCoordR = Out.texCoord + d.xz;
32 | Out.texCoordT = Out.texCoord - d.zy;
33 | Out.texCoordB = Out.texCoord + d.zy;
34 | Out.noiseCoord = Out.maskCoord + uParam.zw;
35 |
36 | return Out;
37 | }
38 |
39 | #else // PIXEL
40 |
41 | #define WATER_VEL 1.4
42 | #define WATER_VIS 0.995
43 |
44 | half4 main(VS_OUTPUT In) : COLOR0 {
45 | half4 v = SAMPLE_2D_POINT(sNormal, In.texCoord.xy); // height, speed
46 |
47 | half average = (
48 | SAMPLE_2D_POINT(sNormal, In.texCoordL).x +
49 | SAMPLE_2D_POINT(sNormal, In.texCoordR).x +
50 | SAMPLE_2D_POINT(sNormal, In.texCoordT).x +
51 | SAMPLE_2D_POINT(sNormal, In.texCoordB).x) * 0.25;
52 |
53 | // integrate
54 | v.y += (average - v.x) * WATER_VEL;
55 | v.y *= WATER_VIS;
56 | v.x += v.y;
57 | v.x += (SAMPLE_2D_LINEAR_WRAP(sDiffuse, In.noiseCoord).x * 2.0 - 1.0) * 0.00025;
58 |
59 | v *= SAMPLE_2D_POINT(sMask, In.maskCoord).r;
60 |
61 | return v;
62 | }
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/src/sprite.h:
--------------------------------------------------------------------------------
1 | #ifndef H_SPRITE
2 | #define H_SPRITE
3 |
4 | #include "controller.h"
5 |
6 | struct Sprite : Controller {
7 |
8 | enum {
9 | FRAME_ANIMATED = -1,
10 | FRAME_RANDOM = -2,
11 | };
12 |
13 | bool instant;
14 | int frame, flag;
15 | float time;
16 | vec3 velocity;
17 |
18 | Sprite(IGame *game, int entity, bool instant = true, int frame = FRAME_ANIMATED) : Controller(game, entity), instant(instant), flag(frame), time(0), velocity(0) {
19 | if (frame >= 0) { // specific frame
20 | this->frame = frame;
21 | } else if (frame == FRAME_RANDOM) { // random frame
22 | this->frame = rand() % getSequence().sCount;
23 | } else if (frame == FRAME_ANIMATED) { // animated
24 | this->frame = 0;
25 | }
26 | }
27 |
28 | TR::SpriteSequence& getSequence() {
29 | return level->spriteSequences[-(getEntity().modelIndex + 1)];
30 | }
31 |
32 | virtual void update() {
33 | if (flag >= 0) return;
34 |
35 | bool remove = false;
36 | time += Core::deltaTime;
37 |
38 | if (flag == FRAME_ANIMATED) {
39 | frame = int(time * SPRITE_FPS);
40 | TR::SpriteSequence &seq = getSequence();
41 | if (instant && frame >= seq.sCount)
42 | remove = true;
43 | else
44 | frame %= max(seq.sCount, int16(1));
45 | } else
46 | if (instant && time >= (1.0f / SPRITE_FPS))
47 | remove = true;
48 |
49 | pos += velocity * (30.0f * Core::deltaTime);
50 |
51 | if (remove)
52 | game->removeEntity(this);
53 | }
54 |
55 | virtual void render(Frustum *frustum, MeshBuilder *mesh, Shader::Type type, bool caustics) {
56 | renderSprite(frame);
57 | }
58 | };
59 |
60 | #endif
--------------------------------------------------------------------------------
/src/tools/glyphs/glyphs.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2042
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glyphs", "glyphs.vcxproj", "{3031FCE5-2BF7-4003-9732-9C095E5D07B3}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {3031FCE5-2BF7-4003-9732-9C095E5D07B3}.Debug|x64.ActiveCfg = Debug|x64
17 | {3031FCE5-2BF7-4003-9732-9C095E5D07B3}.Debug|x64.Build.0 = Debug|x64
18 | {3031FCE5-2BF7-4003-9732-9C095E5D07B3}.Debug|x86.ActiveCfg = Debug|Win32
19 | {3031FCE5-2BF7-4003-9732-9C095E5D07B3}.Debug|x86.Build.0 = Debug|Win32
20 | {3031FCE5-2BF7-4003-9732-9C095E5D07B3}.Release|x64.ActiveCfg = Release|x64
21 | {3031FCE5-2BF7-4003-9732-9C095E5D07B3}.Release|x64.Build.0 = Release|x64
22 | {3031FCE5-2BF7-4003-9732-9C095E5D07B3}.Release|x86.ActiveCfg = Release|Win32
23 | {3031FCE5-2BF7-4003-9732-9C095E5D07B3}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {9D72AAC3-A13E-4773-962A-1D73EE9AAA89}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/src/tools/glyphs/main.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/tools/glyphs/main.cpp
--------------------------------------------------------------------------------
/src/ui.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XProger/OpenLara/cdeeed4aa91c76d51c8c1731666c159549166859/src/ui.h
--------------------------------------------------------------------------------