├── lib ├── utilities │ ├── vbwav │ ├── vbwavOSX │ ├── padder.exe │ ├── vbwavLinux │ ├── padder_linux │ ├── MIDI-Converter.zip │ ├── wav.sh │ └── padder_linux.c ├── palette │ ├── 4Color.act │ ├── 4Color.png │ ├── 7Color.act │ ├── 7Color.png │ ├── 7ColorSplitBase.act │ ├── 7ColorSplitBase.png │ ├── 7ColorSplitFrame2.act │ ├── 7ColorSplitFrame2.png │ ├── 7ColorSplitOverlay.act │ └── 7ColorSplitOverlay.png └── compiler │ ├── preprocessor │ ├── printProgress.sh │ ├── virtualMethodTraduction.awk │ ├── normalMethodTraduction.awk │ ├── printCompilingInfo.sh │ ├── processGCCOutput.sh │ └── cleanSyntax.sh │ └── make │ ├── makefile-compiler │ ├── makefile-preprocess │ └── makefile ├── doc ├── PCM-Playback.xlsx ├── Fixed-data-types.xlsx ├── 3D-2D-Projections.xlsx ├── remarks.txt └── build.txt ├── .gitattributes ├── art └── logos │ └── VUEngine3D.png ├── .gitignore ├── .github └── FUNDING.yml ├── contributions ├── TemplateConfig │ ├── Config.templateConfig │ ├── Messages.templateConfig │ ├── GameEvents.templateConfig │ ├── InGameTypes.templateConfig │ ├── ColliderLayers.templateConfig │ ├── RumbleEffects.templateConfig │ ├── ActorSpec.templateConfig │ ├── FontSpec.templateConfig │ ├── SoundSpec.templateConfig │ ├── ColumnTableSpec.templateConfig │ ├── RumbleEffectSpec.templateConfig │ ├── configMake.templateConfig │ ├── BrightnessRepeatSpec.templateConfig │ ├── vbToolsLd.templateConfig │ ├── ActorImageData.templateConfig │ ├── FontsC.templateConfig │ ├── FontsH.templateConfig │ └── vbLd.templateConfig ├── Type │ ├── Events.type │ ├── Messages.type │ ├── InGameTypes.type │ ├── ColliderLayers.type │ ├── BrightnessRepeat.type │ ├── ColumnTable.type │ ├── Logic.type │ ├── RumbleEffect.type │ └── Font.type └── Template │ ├── GameEvents.h.njk │ ├── InGameTypes.h.njk │ ├── Messages.h.njk │ ├── ColliderLayers.h.njk │ ├── RumbleEffects.h.njk │ ├── Fonts.h.njk │ ├── BrightnessRepeatSpec.c.njk │ ├── Fonts.c.njk │ ├── ColumnTableSpec.c.njk │ ├── ActorImageData.c.njk │ ├── RumbleEffectSpec.c.njk │ └── config.make.njk ├── assets ├── Waveform │ ├── Square.waveform │ ├── SquareDuty75.waveform │ ├── SawSquare.waveform │ ├── Sine.waveform │ ├── Organ.waveform │ ├── Saw.waveform │ ├── Triangle.waveform │ ├── Violin.waveform │ ├── Glocken.waveform │ ├── Piano.waveform │ ├── Roland.waveform │ ├── Trumpet.waveform │ ├── SinePlusAlpha.waveform │ └── Converted │ │ ├── SineWaveFormSpec.c │ │ ├── SquareWaveFormSpec.c │ │ ├── SawSquareWaveFormSpec.c │ │ ├── SawWaveFormSpec.c │ │ ├── SquareDuty75WaveFormSpec.c │ │ ├── OrganWaveFormSpec.c │ │ ├── PianoWaveFormSpec.c │ │ ├── RolandWaveFormSpec.c │ │ ├── ViolinWaveFormSpec.c │ │ ├── GlockenWaveFormSpec.c │ │ ├── TriangleWaveFormSpec.c │ │ ├── TrumpetWaveFormSpec.c │ │ └── SinePlusAlphaWaveFormSpec.c ├── BrightnessRepeat │ ├── Default.brightness │ └── Converted │ │ └── DefaultBrightnessRepeatSpec.c ├── Fonts.c └── ColumnTable │ └── Converted │ └── DefaultColumnTableSpec.c ├── config ├── RomInfo ├── Messages ├── CompilerConfig └── Events ├── headers ├── MinimalLib.h ├── LibVUEngine.h ├── Fonts.h └── WaveForms.h ├── source ├── Misc │ ├── Globals.h │ ├── Utilities │ │ └── Utilities.c │ ├── Math │ │ ├── Scale.c │ │ ├── Rotation.c │ │ ├── PixelVector.c │ │ ├── Vector2D.c │ │ ├── Vector3D.c │ │ ├── PixelSize.h │ │ └── Size.h │ ├── Time │ │ ├── Stopwatch.h │ │ ├── StopwatchManager.h │ │ └── ClockManager.h │ ├── Lists │ │ ├── VirtualNode.h │ │ └── VirtualNode.c │ ├── Optics.h │ ├── Messaging │ │ ├── Telegram.h │ │ ├── Events.h │ │ └── Telegram.c │ ├── FrameRate │ │ └── FrameRate.h │ └── Memory │ │ └── Mem.c ├── Component │ ├── Collider │ │ ├── Box │ │ │ └── InverseBox │ │ │ │ ├── InverseBox.h │ │ │ │ └── InverseBox.c │ │ ├── CollisionTester.h │ │ └── Ball │ │ │ └── Ball.h │ ├── VisualComponent │ │ ├── Sprite │ │ │ ├── Texture │ │ │ │ └── ObjectTexture │ │ │ │ │ ├── ObjectTexture.c │ │ │ │ │ ├── ObjectTextureManager.h │ │ │ │ │ └── ObjectTexture.h │ │ │ ├── AnimationController │ │ │ │ └── AnimationCoordinatorFactory.h │ │ │ ├── ObjectSpriteContainer │ │ │ │ └── ObjectSpriteContainer.h │ │ │ └── BgmapSprite │ │ │ │ └── FrameBlendBgmapSprite │ │ │ │ ├── FrameBlendBgmapSprite.c │ │ │ │ └── FrameBlendBgmapSprite.h │ │ └── Wireframe │ │ │ ├── Line │ │ │ ├── Line.h │ │ │ └── Line.c │ │ │ └── Asterisk │ │ │ └── Asterisk.h │ ├── Mutator │ │ ├── MutatorManager.h │ │ ├── Mutator.c │ │ └── Mutator.h │ └── Behavior │ │ ├── BehaviorManager.h │ │ ├── Behavior.c │ │ └── Behavior.h ├── State │ ├── GameState │ │ └── ToolState │ │ │ ├── DebugState │ │ │ ├── DebugState.h │ │ │ └── DebugState.c │ │ │ ├── StageEditorState │ │ │ ├── StageEditorState.h │ │ │ └── StageEditorState.c │ │ │ ├── AnimationInspectorState │ │ │ ├── AnimationInspectorState.h │ │ │ └── AnimationInspectorState.c │ │ │ └── SoundTestState │ │ │ ├── SoundTestState.h │ │ │ └── SoundTestState.c │ ├── State.h │ └── State.c ├── Debugging │ ├── Error │ │ └── Error.h │ └── Tool │ │ ├── SoundTest │ │ └── SoundTest.h │ │ ├── Tool.h │ │ ├── StageEditor │ │ └── StageEditor.h │ │ ├── Debug │ │ └── Debug.h │ │ └── AnimationInspector │ │ └── AnimationInspector.h ├── Entity │ └── Container │ │ └── UIContainer │ │ └── UIContainer.h └── Hardware │ └── SRAMManager.h └── LICENSE /lib/utilities/vbwav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/utilities/vbwav -------------------------------------------------------------------------------- /doc/PCM-Playback.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/doc/PCM-Playback.xlsx -------------------------------------------------------------------------------- /lib/palette/4Color.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/4Color.act -------------------------------------------------------------------------------- /lib/palette/4Color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/4Color.png -------------------------------------------------------------------------------- /lib/palette/7Color.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/7Color.act -------------------------------------------------------------------------------- /lib/palette/7Color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/7Color.png -------------------------------------------------------------------------------- /lib/utilities/vbwavOSX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/utilities/vbwavOSX -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Force LF line endings on checkout for scripts 2 | *.awk text eol=lf 3 | *.sh text eol=lf -------------------------------------------------------------------------------- /art/logos/VUEngine3D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/art/logos/VUEngine3D.png -------------------------------------------------------------------------------- /doc/Fixed-data-types.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/doc/Fixed-data-types.xlsx -------------------------------------------------------------------------------- /lib/utilities/padder.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/utilities/padder.exe -------------------------------------------------------------------------------- /lib/utilities/vbwavLinux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/utilities/vbwavLinux -------------------------------------------------------------------------------- /doc/3D-2D-Projections.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/doc/3D-2D-Projections.xlsx -------------------------------------------------------------------------------- /lib/utilities/padder_linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/utilities/padder_linux -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .history 2 | .vscode/ipch 3 | build/ 4 | release.bat 5 | v810_err.txt 6 | .DS_Store 7 | doc/html/ 8 | 9 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: ["https://www.paypal.me/KR155E"] 4 | -------------------------------------------------------------------------------- /lib/compiler/preprocessor/printProgress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | while : ; do 4 | sleep 0.5 5 | echo -n "." 6 | done 7 | -------------------------------------------------------------------------------- /lib/palette/7ColorSplitBase.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/7ColorSplitBase.act -------------------------------------------------------------------------------- /lib/palette/7ColorSplitBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/7ColorSplitBase.png -------------------------------------------------------------------------------- /lib/utilities/MIDI-Converter.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/utilities/MIDI-Converter.zip -------------------------------------------------------------------------------- /lib/palette/7ColorSplitFrame2.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/7ColorSplitFrame2.act -------------------------------------------------------------------------------- /lib/palette/7ColorSplitFrame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/7ColorSplitFrame2.png -------------------------------------------------------------------------------- /lib/palette/7ColorSplitOverlay.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/7ColorSplitOverlay.act -------------------------------------------------------------------------------- /lib/palette/7ColorSplitOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUEngine/VUEngine-Core/HEAD/lib/palette/7ColorSplitOverlay.png -------------------------------------------------------------------------------- /contributions/TemplateConfig/Config.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "headers/Config.h", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/Config.h.njk" 7 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/Messages.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "headers/Messages.h", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/Messages.h.njk" 7 | } -------------------------------------------------------------------------------- /assets/Waveform/Square.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "DyL0pycvSqXcRbj8", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 60,64,64,64,64,64,64,64,64,64,64,64,64,64,64,60,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/SquareDuty75.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "HhyDChu5lbaTA9YF", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 39,26,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,28,43,64,64,64,64,64,64 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /contributions/TemplateConfig/GameEvents.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "headers/GameEvents.h", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/GameEvents.h.njk" 7 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/InGameTypes.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "headers/InGameTypes.h", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/InGameTypes.h.njk" 7 | } -------------------------------------------------------------------------------- /assets/Waveform/SawSquare.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "sxbCyI9EXlWeEmmD", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 1,1,1,1,1,1,1,1,1,1,1,1,9,17,25,27,41,49,57,64,64,64,64,64,64,64,64,64,64,64,64,64 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/Sine.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "6QP1zxkpXVn9SMlC", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 64,63,61,58,54,49,43,36,29,22,16,11,7,4,2,1,1,2,4,7,11,16,22,29,36,43,49,54,58,61,63,64 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/Organ.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "BwHW7JNrex6wMinO", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 27,64,57,57,40,36,40,18,20,39,13,39,36,35,31,1,27,64,36,31,31,27,54,27,45,48,27,30,27,9,10,1 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/Saw.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "S17ifoKaHu4DdzeZ", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 63,61,59,57,55,53,51,49,47,45,43,41,39,37,35,33,31,29,27,25,23,21,19,17,15,13,11,9,7,5,3,1 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/Triangle.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "XpMdT55BQzCPKlVX", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 61,57,53,49,45,41,37,33,29,25,21,17,13,9,5,1,1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/Violin.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "51fdDnFQlDtpmU6W", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 2,19,38,39,20,27,29,30,5,1,20,2,24,27,17,49,50,51,62,50,55,60,39,33,31,52,63,52,56,55,42,16 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /contributions/TemplateConfig/ColliderLayers.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "headers/ColliderLayers.h", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/ColliderLayers.h.njk" 7 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/RumbleEffects.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "headers/RumbleEffects.h", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/RumbleEffects.h.njk" 7 | } -------------------------------------------------------------------------------- /assets/Waveform/Glocken.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "zWndaKELk5FT82xf", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 27,54,39,46,51,26,30,43,37,49,63,47,38,34,4,25,27,41,42,32,29,19,3,17,29,23,36,40,16,20,27,12 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/Piano.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "h6pHqEdKMGJU4HHl", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 32,29,31,46,50,35,28,29,28,26,28,42,45,47,51,48,58,62,51,44,34,37,34,25,21,33,34,20,27,22,21,30 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/Roland.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "BtrphhgkaHkkgdO3", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 16,48,64,55,48,40,36,34,32,32,32,32,32,32,32,32,28,16,1,8,16,24,28,30,32,32,32,32,32,32,32,32 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/Waveform/Trumpet.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "D28pZWSn7EQDMtgR", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 39,38,36,33,33,36,36,34,31,35,39,40,39,35,33,40,38,17,1,41,43,36,32,31,31,34,38,35,33,35,38,40 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /config/RomInfo: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "0.6.0", 3 | "gameCodeId": "VU", 4 | "gameCodeLanguage": "E", 5 | "gameCodeSystem": "V", 6 | "gameTitle": "VUENGINE PROJECT", 7 | "makerCode": "VU", 8 | "revision": 0 9 | } 10 | -------------------------------------------------------------------------------- /assets/Waveform/SinePlusAlpha.waveform: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "2v98yCQLE9E9Tkok", 3 | "_version": "0.6.0", 4 | "values": [ 5 | 3,7,12,16,16,15,14,17,4,27,42,49,52,52,32,32,54,58,63,47,47,52,43,36,27,27,27,30,23,15,7,3 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /contributions/TemplateConfig/ActorSpec.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "Converted/${_filename}ActorSpec.c", 4 | "root": "file" 5 | }], 6 | "template": "contributions/Template/ActorSpec.c.njk", 7 | "itemSpecific": "Actor" 8 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/FontSpec.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "Converted/${_filename}FontSpec.c", 4 | "root": "file" 5 | }], 6 | "template": "contributions/Template/FontSpec.c.njk", 7 | "itemSpecific": "Font" 8 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/SoundSpec.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "Converted/${_filename}SoundSpec.c", 4 | "root": "file" 5 | }], 6 | "template": "contributions/Template/SoundSpec.c.njk", 7 | "itemSpecific": "Sound" 8 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/ColumnTableSpec.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "Converted/${_filename}ColumnTableSpec.c", 4 | "root": "file" 5 | }], 6 | "template": "contributions/Template/ColumnTableSpec.c.njk", 7 | "itemSpecific": "ColumnTable" 8 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/RumbleEffectSpec.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "Converted/${_filename}RumbleEffectSpec.c", 4 | "root": "file" 5 | }], 6 | "template": "contributions/Template/RumbleEffectSpec.c.njk", 7 | "itemSpecific": "RumbleEffect" 8 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/configMake.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "config.make", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/config.make.njk", 7 | "events": [{ 8 | "type": "installedPluginsChanged" 9 | }] 10 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/BrightnessRepeatSpec.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "Converted/${_filename}BrightnessRepeatSpec.c", 4 | "root": "file" 5 | }], 6 | "template": "contributions/Template/BrightnessRepeatSpec.c.njk", 7 | "itemSpecific": "BrightnessRepeat" 8 | } -------------------------------------------------------------------------------- /lib/compiler/preprocessor/virtualMethodTraduction.awk: -------------------------------------------------------------------------------- 1 | NR == FNR { 2 | rep[$1] = $2 3 | next 4 | } 5 | 6 | { 7 | for (key in rep) 8 | { 9 | pattern="[ ][ ]*"key"[ ]*[(]" 10 | replacement=" "rep[key] 11 | gsub(pattern, replacement) 12 | } 13 | print 14 | } 15 | -------------------------------------------------------------------------------- /contributions/TemplateConfig/vbToolsLd.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "lib/compiler/linker/vb_tools.ld", 4 | "root": "project" 5 | }, { 6 | "path": "lib/compiler/linker/vb_debug.ld", 7 | "root": "project" 8 | }], 9 | "template": "contributions/Template/vb_tools.ld.njk" 10 | } -------------------------------------------------------------------------------- /doc/remarks.txt: -------------------------------------------------------------------------------- 1 | Only one check of collision between two colliders is performed. 2 | If the first does nothing with the collision, the second 3 | collider is not checked. 4 | 5 | 6 | LIMITATIONS 7 | 8 | Parenting: 9 | 1) Cannot add children during the initialization phase (initialize method) 10 | 2) -------------------------------------------------------------------------------- /lib/compiler/make/makefile-compiler: -------------------------------------------------------------------------------- 1 | # compiler 2 | COMPILER_VERSION = 4.7 3 | COMPILER_NAME = v810 4 | 5 | CC = $(COMPILER_NAME)-gcc 6 | AS = $(COMPILER_NAME)-as 7 | AR = $(COMPILER_NAME)-ar 8 | LD = $(COMPILER_NAME)-ld 9 | OBJCOPY = $(COMPILER_NAME)-objcopy 10 | OBJDUMP = $(COMPILER_NAME)-objdump 11 | -------------------------------------------------------------------------------- /contributions/TemplateConfig/ActorImageData.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "Converted/${_filename}ActorImageData.c", 4 | "root": "file", 5 | "conditions": { ">": [{ "var": "components.sprites.length" }, 0] } 6 | }], 7 | "template": "contributions/Template/ActorImageData.c.njk", 8 | "itemSpecific": "Actor" 9 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/FontsC.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "assets/Fonts.c", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/Fonts.c.njk", 7 | "events": [{ 8 | "type": "installedPluginsChanged" 9 | }, { 10 | "type": "itemOfTypeGotDeleted", 11 | "value": "Font" 12 | }] 13 | } -------------------------------------------------------------------------------- /contributions/TemplateConfig/FontsH.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "headers/Fonts.h", 4 | "root": "project" 5 | }], 6 | "template": "contributions/Template/Fonts.h.njk", 7 | "events": [{ 8 | "type": "installedPluginsChanged" 9 | }, { 10 | "type": "itemOfTypeGotDeleted", 11 | "value": "Font" 12 | }] 13 | } -------------------------------------------------------------------------------- /lib/compiler/preprocessor/normalMethodTraduction.awk: -------------------------------------------------------------------------------- 1 | NR == FNR { 2 | rep[$1] = $2 3 | next 4 | } 5 | 6 | { 7 | for (key in rep) 8 | { 9 | pattern="[ ][ ]*"key"[ ]*[(]" 10 | className=substr(rep[key], 1, match(rep[key], "_")-1) 11 | replacement=" "rep[key]"(("className")" 12 | gsub(pattern, replacement) 13 | } 14 | print 15 | } 16 | -------------------------------------------------------------------------------- /contributions/TemplateConfig/vbLd.templateConfig: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [{ 3 | "path": "lib/compiler/linker/vb_shipping.ld", 4 | "root": "project" 5 | }, { 6 | "path": "lib/compiler/linker/vb_release.ld", 7 | "root": "project" 8 | }, { 9 | "path": "lib/compiler/linker/vb_beta.ld", 10 | "root": "project" 11 | }], 12 | "template": "contributions/Template/vb.ld.njk" 13 | } -------------------------------------------------------------------------------- /assets/BrightnessRepeat/Default.brightness: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "HJzLvhLSpJs16gla", 3 | "_version": "0.6.0", 4 | "description": "The default brightness repeat configuration as provided by Nintendo.", 5 | "mirror": true, 6 | "values": [ 7 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /contributions/Type/Events.type: -------------------------------------------------------------------------------- 1 | { 2 | "file": "Events", 3 | "schema": { 4 | "title": "Events", 5 | "properties": { 6 | "events": { 7 | "type": "object", 8 | "properties": {}, 9 | "additionalProperties": { 10 | "type": "string" 11 | } 12 | } 13 | }, 14 | "required": [] 15 | }, 16 | "uiSchema": { 17 | "type": "SimpleListEditor", 18 | "scope": "#/properties/events" 19 | }, 20 | "icon": "codicon codicon-symbol-event", 21 | "templates": [ 22 | "GameEvents" 23 | ] 24 | } -------------------------------------------------------------------------------- /contributions/Type/Messages.type: -------------------------------------------------------------------------------- 1 | { 2 | "file": "Messages", 3 | "schema": { 4 | "title": "Messages", 5 | "properties": { 6 | "messages": { 7 | "type": "object", 8 | "properties": {}, 9 | "additionalProperties": { 10 | "type": "string" 11 | } 12 | } 13 | }, 14 | "required": [] 15 | }, 16 | "uiSchema": { 17 | "type": "SimpleListEditor", 18 | "scope": "#/properties/messages" 19 | }, 20 | "icon": "codicon codicon-comment", 21 | "templates": [ 22 | "Messages" 23 | ] 24 | } -------------------------------------------------------------------------------- /contributions/Type/InGameTypes.type: -------------------------------------------------------------------------------- 1 | { 2 | "file": "InGameTypes", 3 | "schema": { 4 | "title": "In-Game Types", 5 | "properties": { 6 | "types": { 7 | "type": "object", 8 | "properties": {}, 9 | "additionalProperties": { 10 | "type": "string" 11 | } 12 | } 13 | }, 14 | "required": [] 15 | }, 16 | "uiSchema": { 17 | "type": "SimpleListEditor", 18 | "scope": "#/properties/types" 19 | }, 20 | "icon": "codicon codicon-broadcast", 21 | "templates": [ 22 | "InGameTypes" 23 | ] 24 | } -------------------------------------------------------------------------------- /contributions/Type/ColliderLayers.type: -------------------------------------------------------------------------------- 1 | { 2 | "file": "ColliderLayers", 3 | "schema": { 4 | "title": "Collider Layers", 5 | "properties": { 6 | "layers": { 7 | "type": "object", 8 | "properties": {}, 9 | "additionalProperties": { 10 | "type": "string" 11 | } 12 | } 13 | }, 14 | "required": [] 15 | }, 16 | "uiSchema": { 17 | "type": "SimpleListEditor", 18 | "scope": "#/properties/layers" 19 | }, 20 | "icon": "codicon codicon-activate-breakpoints", 21 | "templates": [ 22 | "ColliderLayers" 23 | ] 24 | } -------------------------------------------------------------------------------- /config/Messages: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "0.6.0", 3 | "messages": { 4 | "0RIWN82RDpCMzoE7": "BodyBounced", 5 | "cTP9gUwK3IvUA9U9": "KeyPressed", 6 | "emBKcP48fmjZ9wiM": "KeyReleased", 7 | "GkoBRXRw5Pq70Jyq": "HighFps", 8 | "iHAIR7A46isXvCLl": "ActorRemoved", 9 | "o84IKELf08geYv9d": "BodyStopped", 10 | "PQhieVBokeMJFlsR": "BodyStartedMoving", 11 | "TJUjFLiwan2nD4pz": "CheckIfRemoteIsReady", 12 | "tq5FNneWvkx8Xnlt": "BodyChangedDirection", 13 | "wpco0nrjPzSHy7bl": "LastCommunicationMessage", 14 | "y380WYtXnaHpG35p": "KeyHold" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/compiler/preprocessor/printCompilingInfo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | INPUT_FILE=$1 4 | 5 | message="Compiling file: $INPUT_FILE" 6 | 7 | if [ -z "${INPUT_FILE##*assets/*}" ]; 8 | then 9 | message=`sed -e 's#^.*assets/\(.*$\)#Compiling asset: \1#g' <<< $INPUT_FILE` 10 | fi 11 | 12 | if [ -z "${INPUT_FILE##*source*}" ]; 13 | then 14 | message=`sed -e 's#^.*source[s]*/\(.*$\)#Compiling file: \1#g' <<< $INPUT_FILE` 15 | else 16 | if [ -z "${INPUT_FILE##*object*}" ]; 17 | then 18 | message=`sed -e 's#^.*object[s]*/\(.*$\)#Compiling file: \1#g' <<< $INPUT_FILE` 19 | fi 20 | fi 21 | 22 | echo "$message" -------------------------------------------------------------------------------- /contributions/Template/GameEvents.h.njk: -------------------------------------------------------------------------------- 1 | {%- set events = project.items.Events.project -%} 2 | {%- import 'templates/partials/macros.njk' as macros -%} 3 | {% include('templates/partials/fileHeader/fileHeader.h.njk') %} 4 | 5 | #ifndef GAME_EVENTS_H_ 6 | #define GAME_EVENTS_H_ 7 | 8 | {{ macros.sectionHeader('Includes') }} 9 | 10 | #include 11 | 12 | {{ macros.sectionHeader('Definitions') }} 13 | 14 | {% if events.events | length > 0 -%} 15 | enum GameEvents 16 | { 17 | {%- for event in events.events | values | removeEmpty | sort %} 18 | kEvent{{ event | sanitizeSpecName }}{% if loop.first %} = kEventGameFirst + 1{% endif %}, 19 | {%- endfor %} 20 | }; 21 | {%- endif %} 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /contributions/Template/InGameTypes.h.njk: -------------------------------------------------------------------------------- 1 | {%- set types = project.items.InGameTypes.project -%} 2 | {%- import 'templates/partials/macros.njk' as macros -%} 3 | {% include('templates/partials/fileHeader/fileHeader.h.njk') %} 4 | 5 | #ifndef IN_GAME_TYPES_H_ 6 | #define IN_GAME_TYPES_H_ 7 | 8 | {{ macros.sectionHeader('Includes') }} 9 | 10 | #include 11 | 12 | {{ macros.sectionHeader('Definitions') }} 13 | 14 | {% if types.types | length > 0 -%} 15 | enum InGameTypes 16 | { 17 | {%- for type in types.types | values | removeEmpty | sort %} 18 | kType{{ type | sanitizeSpecName }}{% if loop.first %} = kTypeNone + 1{% endif %}, 19 | {%- endfor %} 20 | }; 21 | {%- endif %} 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /contributions/Template/Messages.h.njk: -------------------------------------------------------------------------------- 1 | {%- set messages = project.items.Messages.project -%} 2 | {%- import 'templates/partials/macros.njk' as macros -%} 3 | {% include('templates/partials/fileHeader/fileHeader.h.njk') %} 4 | 5 | #ifndef MESSAGES_H_ 6 | #define MESSAGES_H_ 7 | 8 | {{ macros.sectionHeader('Includes') }} 9 | 10 | #include 11 | 12 | {{ macros.sectionHeader('Definitions') }} 13 | 14 | {% if messages.messages | length > 0 -%} 15 | enum Messages 16 | { 17 | {%- for message in messages.messages | values | removeEmpty | sort %} 18 | kMessage{{ message | sanitizeSpecName }}{% if loop.first %} = kMessageLastEngine + 1{% endif %}, 19 | {%- endfor %} 20 | }; 21 | {%- endif %} 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /headers/MinimalLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef MINIMAL_LIB_H_ 11 | #define MINIMAL_LIB_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /config/CompilerConfig: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "0.6.0", 3 | "framePointer": false, 4 | "memorySections": { 5 | "dram": { 6 | "length": 32, 7 | "origin": "0x0003D800" 8 | }, 9 | "exp": { 10 | "length": 16, 11 | "origin": "0x04000000" 12 | }, 13 | "rom": { 14 | "length": 16, 15 | "origin": "0x07000000" 16 | }, 17 | "sram": { 18 | "length": 16, 19 | "origin": "0x06000000" 20 | }, 21 | "wram": { 22 | "length": 64, 23 | "origin": "0x05000000" 24 | } 25 | }, 26 | "memoryUsage": { 27 | "initializedData": ".sdata", 28 | "memoryPool": ".sdata", 29 | "staticSingletons": ".dram_bss", 30 | "uninitializedData": ".sbss", 31 | "virtualTables": ".dram_bss" 32 | }, 33 | "optimization": "O2", 34 | "prologFunctions": false 35 | } 36 | -------------------------------------------------------------------------------- /contributions/Type/BrightnessRepeat.type: -------------------------------------------------------------------------------- 1 | { 2 | "file": ".brightness", 3 | "schema": { 4 | "title": "Brightness Repeat", 5 | "properties": { 6 | "description": { 7 | "type": "string", 8 | "default": "" 9 | }, 10 | "mirror": { 11 | "type": "boolean", 12 | "default": true 13 | }, 14 | "values": { 15 | "type": "array", 16 | "items": { 17 | "type": "integer", 18 | "default": 0, 19 | "minimum": 0, 20 | "maximum": 15 21 | }, 22 | "maxItems": 96, 23 | "minItems": 48 24 | } 25 | }, 26 | "required": [] 27 | }, 28 | "uiSchema": { 29 | "type": "BrightnessRepeatEditor", 30 | "scope": "#" 31 | }, 32 | "icon": "codicon codicon-color-mode", 33 | "templates": [ 34 | "BrightnessRepeatSpec" 35 | ] 36 | } -------------------------------------------------------------------------------- /contributions/Template/ColliderLayers.h.njk: -------------------------------------------------------------------------------- 1 | {%- set layers = project.items.ColliderLayers.project -%} 2 | {%- import 'templates/partials/macros.njk' as macros -%} 3 | {% include('templates/partials/fileHeader/fileHeader.h.njk') %} 4 | 5 | #ifndef COLLIDER_LAYERS_H_ 6 | #define COLLIDER_LAYERS_H_ 7 | 8 | {{ macros.sectionHeader('Includes') }} 9 | 10 | #include 11 | 12 | {{ macros.sectionHeader('Definitions') }} 13 | 14 | {% if layers.layers | length > 0 -%} 15 | enum ColliderLayers 16 | { 17 | {%- set current = 0 -%} 18 | {%- for layer in layers.layers | values | removeEmpty | sort -%} 19 | {%- set current = current + 1 %} 20 | kLayer{{ layer | sanitizeSpecName }} = 1 << (kLayerNone + {{ current }}), 21 | {%- endfor %} 22 | kLayerAll = __COLLISION_ALL_LAYERS, 23 | }; 24 | {%- endif %} 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /source/Misc/Globals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef GLOBALS_H_ 11 | #define GLOBALS_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // GLOBALS FORWARD DECLARATIONS 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | extern bool _stackHeadroomViolation; 18 | extern int32 _vuengineLinkPointer; 19 | extern int32 _vuengineStackPointer; 20 | extern bool _triggeringException; 21 | extern uint32 _bssEnd; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /contributions/Template/RumbleEffects.h.njk: -------------------------------------------------------------------------------- 1 | {%- import 'templates/partials/macros.njk' as macros -%} 2 | {%- set itemNames = [] -%} 3 | {%- if project.items.RumbleEffect is defined -%} 4 | {%- for item in project.items.RumbleEffect | values | unique('_fileUri') -%} 5 | {%- set itemSanitizedSpecName = item._fileUri | basename(false) | sanitizeSpecName -%} 6 | {%- set itemNames = (itemNames.push(itemSanitizedSpecName), itemNames) -%} 7 | {%- endfor -%} 8 | {%- endif -%} 9 | {% include('templates/partials/fileHeader/fileHeader.h.njk') %} 10 | 11 | #ifndef RUMBLE_EFFECTS_H_ 12 | #define RUMBLE_EFFECTS_H_ 13 | 14 | {{ macros.sectionHeader('Includes') }} 15 | 16 | #include 17 | 18 | {{ macros.sectionHeader('Declarations') }} 19 | 20 | {% if itemNames %} 21 | {%- for itemName in itemNames | sort -%} 22 | extern RumbleEffectSpec {{ itemName }}RumbleEffectSpec; 23 | {% endfor -%} 24 | {% endif %} 25 | #endif -------------------------------------------------------------------------------- /doc/build.txt: -------------------------------------------------------------------------------- 1 | #Linux 2 | 3 | YOUR_PATH_TO= 4 | YOUR_GAME= 5 | TYPE= 6 | 7 | ENGINE_FOLDER=$YOUR_PATH_TO/vuengine/core 8 | PLUGINS_FOLDER=$YOUR_PATH_TO/vuengine/plugins 9 | USER_PLUGINS_FOLDER=$YOUR_PATH_TO//vuengine/user 10 | MAKEFILE=$YOUR_PATH_TO/vuengine/core/lib/compiler/make/makefile-game 11 | GAME_FOLDER=$YOUR_PATH_TO/$YOUR_GAME 12 | LC_ALL=C 13 | BUILD_ALL=1 14 | MAKE_JOBS=24 15 | PREPROCESSING_WAIT_FOR_LOCK_DELAY_FACTOR=0.0 16 | DUMP_ELF=0 17 | PRINT_PEDANTIC_WARNINGS=0 18 | export PATH=/opt/VUEngine/resources/app/binaries/vuengine-studio-tools/linux/gcc/bin:$PATH 19 | 20 | make all -e TYPE=$TYPE -f $MAKEFILE -C $GAME_FOLDER -e ENGINE_FOLDER=$ENGINE_FOLDER -e PLUGINS_FOLDER=$PLUGINS_FOLDER -e USER_PLUGINS_FOLDER=$USER_PLUGINS_FOLDER -e LC_ALL=$LC_ALL -e BUILD_ALL=$BUILD_ALL -e MAKE_JOBS=$MAKE_JOBS -e PREPROCESSING_WAIT_FOR_LOCK_DELAY_FACTOR=$ -e DUMP_ELF=$DUMP_ELF -e PRINT_PEDANTIC_WARNINGS=$PRINT_PEDANTIC_WARNINGS -------------------------------------------------------------------------------- /contributions/Template/Fonts.h.njk: -------------------------------------------------------------------------------- 1 | {%- import 'templates/partials/macros.njk' as macros -%} 2 | {%- set itemNames = [] -%} 3 | {%- if project.items.WaveForm is defined -%} 4 | {%- for item in project.items.Font | values | unique('_fileUri') -%} 5 | {%- set itemSanitizedSpecName = item._fileUri | basename(false) | sanitizeSpecName -%} 6 | {%- if item._contributor != "engine" -%} 7 | {%- set itemNames = (itemNames.push(itemSanitizedSpecName), itemNames) -%} 8 | {%- endif -%} 9 | {%- endfor -%} 10 | {%- endif -%} 11 | {% include('templates/partials/fileHeader/fileHeader.h.njk') %} 12 | 13 | #ifndef FONTS_H_ 14 | #define FONTS_H_ 15 | 16 | {{ macros.sectionHeader('Includes') }} 17 | 18 | #include 19 | #include 20 | 21 | {{ macros.sectionHeader('Declarations') }} 22 | 23 | extern FontSpec DefaultFontSpec; 24 | extern FontSpec ProfilerFontSpec; 25 | extern FontSpec DebugFontSpec; 26 | {% if itemNames %} 27 | {%- for itemName in itemNames | sort -%} 28 | extern FontSpec {{ itemName }}FontSpec; 29 | {% endfor -%} 30 | {% endif %} 31 | #endif -------------------------------------------------------------------------------- /contributions/Type/ColumnTable.type: -------------------------------------------------------------------------------- 1 | { 2 | "file": ".ctable", 3 | "schema": { 4 | "title": "Column Table", 5 | "properties": { 6 | "description": { 7 | "type": "string", 8 | "default": "" 9 | }, 10 | "mirror": { 11 | "type": "boolean", 12 | "default": true 13 | }, 14 | "values": { 15 | "type": "array", 16 | "items": { 17 | "type": "object", 18 | "properties": { 19 | "repeat": { 20 | "type": "integer", 21 | "default": 16, 22 | "minimum": 1, 23 | "maximum": 16 24 | }, 25 | "time": { 26 | "type": "integer", 27 | "default": 16, 28 | "minimum": 1, 29 | "maximum": 16 30 | } 31 | }, 32 | "additionalProperties": false 33 | }, 34 | "maxItems": 256, 35 | "minItems": 128, 36 | "default": [] 37 | } 38 | }, 39 | "required": [] 40 | }, 41 | "uiSchema": { 42 | "type": "ColumnTableEditor", 43 | "scope": "#" 44 | }, 45 | "icon": "codicon codicon-table", 46 | "templates": [ 47 | "ColumnTableSpec" 48 | ] 49 | } -------------------------------------------------------------------------------- /source/Misc/Utilities/Utilities.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | // CLASS' ATTRIBUTES 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | 20 | char _itoaArray[__ITOA_ARRAY_SIZE] = {'\0'}; 21 | const char _itoaNumbers[17] = "0123456789ABCDEF"; 22 | -------------------------------------------------------------------------------- /config/Events: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "0.6.0", 3 | "events": { 4 | "0Hu9jumtTGOiT4z2": "ColliderDeleted", 5 | "0KnAJoSYkv6ClR8a": "SoundFinished", 6 | "0yv3hQg9XiYmpylG": "SecondChanged", 7 | "5j69zdQCeRCxRYwk": "GamePaused", 8 | "5ZxqFvwBAjCBRNsc": "NextStateSet", 9 | "a1REgsl2aybLnKoz": "ActorLoaded", 10 | "BxxriE82uyn5yPY1": "AnimationCompleted", 11 | "C2fMmPPy5ruw4IZV": "ContainerDeleted", 12 | "Cprz8RT2UkVobHCD": "SoundReleased", 13 | "dqnHLaxV09mfnknx": "StageChildStreamedOut", 14 | "GBEccbvG9M9vwnWP": "EffectFadeComplete", 15 | "gNHpbDuIZRio6Mza": "CharSetRewritten", 16 | "I87rbVL1qyRciZ0R": "CommunicationsConnected", 17 | "MFeKLw46Ozg1UcYO": "ColliderChanged", 18 | "oGvWfWA5LkoDe0Wr": "CommunicationsTransmissionCompleted", 19 | "PNmld5oWd85y0Auz": "EffectFadeStop", 20 | "s33KUCAnTTjpEIRt": "EffectFadeStart", 21 | "SAQ55evdKOMljaai": "GameUnpaused", 22 | "TbxUd40M25lV9CVK": "EntityDeleted", 23 | "tRa7oSQaxwhc4IFx": "MinuteChanged", 24 | "yq726YlPOzvEQpd8": "TextureRewritten", 25 | "Zta2HYHn5ph388J8": "CharSetDeleted" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/utilities/wav.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | files=`find . -name "*.wav"` 3 | VUENGINE_HOME="/Users/jorgeche/Documents/work/workspaces/ves/vuengine/core/lib/utilities" 4 | amplitude=$1 5 | output=".h" 6 | 7 | if [ -z "$1" ]; then 8 | amplitude=15 9 | fi 10 | 11 | levels=$(( amplitude / 15 )) 12 | 13 | rm *.c 14 | channels="" 15 | 16 | echo $levels 17 | 18 | for (( i = 1; i <= $levels; i++ )) do 19 | 20 | channels="\&PCMSoundChannel, $channels" 21 | done 22 | 23 | echo channels $channels 24 | 25 | for file in $files; do 26 | 27 | vbwavOSX $file $amplitude 28 | 29 | file=`echo $file | sed -e "s@./@@g"` 30 | echo Processing $file 31 | name=`echo $file | sed -e "s@\.wav@@g"` 32 | # echo $name 33 | finalDestination=`echo $file | sed -e "s@\.wav@SoundTrack@g" | sed -e "s@sample@@g"` 34 | # echo $finalDestination 35 | mv $output $finalDestination.c 36 | sed -i -e 's@sample_@'$finalDestination'@g' $finalDestination.c 37 | sed -i -e "s@static@@g" $finalDestination.c 38 | length=`grep _LEN $finalDestination.c | sed -E "s@.*_LEN@@g"` 39 | echo $length 40 | rm *-e 41 | done 42 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/SineWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData SineWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 63, 62, 60, 57, 53, 48, 42, 35, 28, 21, 15, 10, 6, 3, 1, 0, 0, 1, 3, 6, 10, 15, 21, 28, 35, 42, 48, 53, 57, 60, 62, 63, 16 | }, 17 | 18 | /// Data's CRC 19 | 8, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/SquareWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData SquareWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 59, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 59, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 16 | }, 17 | 18 | /// Data's CRC 19 | 10, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/SawSquareWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData SawSquareWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 16, 24, 26, 40, 48, 56, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 16 | }, 17 | 18 | /// Data's CRC 19 | 5, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/SawWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData SawWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 16 | }, 17 | 18 | /// Data's CRC 19 | 6, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/SquareDuty75WaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData SquareDuty75WaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 38, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 42, 63, 63, 63, 63, 63, 63, 16 | }, 17 | 18 | /// Data's CRC 19 | 9, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/OrganWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData OrganWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 26, 63, 56, 56, 39, 35, 39, 17, 19, 38, 12, 38, 35, 34, 30, 0, 26, 63, 35, 30, 30, 26, 53, 26, 44, 47, 26, 29, 26, 8, 9, 0, 16 | }, 17 | 18 | /// Data's CRC 19 | 2, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/PianoWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData PianoWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 31, 28, 30, 45, 49, 34, 27, 28, 27, 25, 27, 41, 44, 46, 50, 47, 57, 61, 50, 43, 33, 36, 33, 24, 20, 32, 33, 19, 26, 21, 20, 29, 16 | }, 17 | 18 | /// Data's CRC 19 | 3, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/RolandWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData RolandWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 15, 47, 63, 54, 47, 39, 35, 33, 31, 31, 31, 31, 31, 31, 31, 31, 27, 15, 0, 7, 15, 23, 27, 29, 31, 31, 31, 31, 31, 31, 31, 31, 16 | }, 17 | 18 | /// Data's CRC 19 | 4, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/ViolinWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData ViolinWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 1, 18, 37, 38, 19, 26, 28, 29, 4, 0, 19, 1, 23, 26, 16, 48, 49, 50, 61, 49, 54, 59, 38, 32, 30, 51, 62, 51, 55, 54, 41, 15, 16 | }, 17 | 18 | /// Data's CRC 19 | 13, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/GlockenWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData GlockenWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 26, 53, 38, 45, 50, 25, 29, 42, 36, 48, 62, 46, 37, 33, 3, 24, 26, 40, 41, 31, 28, 18, 2, 16, 28, 22, 35, 39, 15, 19, 26, 11, 16 | }, 17 | 18 | /// Data's CRC 19 | 1, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/TriangleWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData TriangleWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 60, 56, 52, 48, 44, 40, 36, 32, 28, 24, 20, 16, 12, 8, 4, 0, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 16 | }, 17 | 18 | /// Data's CRC 19 | 11, 20 | }; 21 | -------------------------------------------------------------------------------- /assets/Waveform/Converted/TrumpetWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData TrumpetWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 38, 37, 35, 32, 32, 35, 35, 33, 30, 34, 38, 39, 38, 34, 32, 39, 37, 16, 0, 40, 42, 35, 31, 30, 30, 33, 37, 34, 32, 34, 37, 39, 16 | }, 17 | 18 | /// Data's CRC 19 | 12, 20 | }; 21 | -------------------------------------------------------------------------------- /contributions/Type/Logic.type: -------------------------------------------------------------------------------- 1 | { 2 | "enabled": false, 3 | "file": ".logic", 4 | "schema": { 5 | "title": "Logic", 6 | "properties": { 7 | "configuration": { 8 | "type": "array", 9 | "items": { 10 | "type": "object", 11 | "properties": { 12 | "name": { 13 | "type": "string" 14 | } 15 | }, 16 | "additionalProperties": false 17 | } 18 | }, 19 | "methods": { 20 | "type": "array", 21 | "items": { 22 | "type": "object", 23 | "properties": { 24 | "type": { 25 | "type": "string", 26 | "default": "custom" 27 | }, 28 | "name": { 29 | "type": "string" 30 | }, 31 | "script": { 32 | "type": "array", 33 | "items": { 34 | "type": "object", 35 | "additionalProperties": true 36 | } 37 | } 38 | }, 39 | "additionalProperties": false 40 | } 41 | } 42 | }, 43 | "required": [] 44 | }, 45 | "uiSchema": { 46 | "type": "LogicEditor", 47 | "scope": "#" 48 | }, 49 | "icon": "codicon codicon-pulse", 50 | "templates": [] 51 | } -------------------------------------------------------------------------------- /assets/Waveform/Converted/SinePlusAlphaWaveFormSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | // DEFINITIONS 9 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 10 | 11 | const WaveformData SinePlusAlphaWaveForm = 12 | { 13 | /// Pointer to the waveform's data 14 | { 15 | 2, 6, 11, 15, 15, 14, 13, 16, 3, 26, 41, 48, 51, 51, 31, 31, 53, 57, 62, 46, 46, 51, 42, 35, 26, 26, 26, 29, 22, 14, 6, 2, 16 | }, 17 | 18 | /// Data's CRC 19 | 7, 20 | }; 21 | -------------------------------------------------------------------------------- /contributions/Template/BrightnessRepeatSpec.c.njk: -------------------------------------------------------------------------------- 1 | {%- set sanitizedSpecName = itemUri | basename(false) | sanitizeSpecName -%} 2 | 3 | {%- import 'templates/partials/macros.njk' as macros -%} 4 | {% include('templates/partials/fileHeader/fileHeader.c.njk') %} 5 | 6 | {{ macros.sectionHeader('Includes') }} 7 | 8 | #include 9 | 10 | {{ macros.sectionHeader('Definitions') }} 11 | 12 | BrightnessRepeatROMSpec {{ sanitizedSpecName }}BrightnessRepeatSpec = 13 | { 14 | // Mirror spec? 15 | {% if item.mirror %}true{% else %}false{% endif %}, 16 | 17 | // Brightness repeat values 18 | { 19 | {% for x in range(0, 96) -%} 20 | {%- if not (item.mirror and loop.index > 48) -%} 21 | {%- set value = item.values[x] | default(0) -%} 22 | {%- if value is null -%} 23 | {%- set value = 0 -%} 24 | {%- endif -%} 25 | {%- if value < 10 -%}{{ ' ' }} {%- endif -%} 26 | {{- value -}}{{- ', '-}} 27 | {%- if loop.index % 16 == 0 and not (loop.last or (item.mirror and loop.index == 48)) -%} 28 | {{ "\n " }} 29 | {%- endif -%} 30 | {%- endif -%} 31 | {%- endfor %} 32 | } 33 | }; -------------------------------------------------------------------------------- /contributions/Template/Fonts.c.njk: -------------------------------------------------------------------------------- 1 | {%- import 'templates/partials/macros.njk' as macros -%} 2 | {%- set itemNames = [] -%} 3 | {%- if project.items.Font is defined-%} 4 | {%- for item in project.items.Font | values | unique('_fileUri') -%} 5 | {%- set itemSanitizedSpecName = item._fileUri | basename(false) | sanitizeSpecName -%} 6 | {%- if item._contributor != "engine" -%} 7 | {%- set itemNames = (itemNames.push(itemSanitizedSpecName), itemNames) -%} 8 | {%- endif -%} 9 | {%- endfor -%} 10 | {%- endif -%} 11 | {% include('templates/partials/fileHeader/fileHeader.c.njk') %} 12 | 13 | {{ macros.sectionHeader('Includes') }} 14 | 15 | #include 16 | 17 | {{ macros.sectionHeader('Definitions') }} 18 | 19 | # Must not be const since the NULL will be replaced during runtime 20 | FontData _fontData[] = 21 | { 22 | {(FontSpec*)&DefaultFontSpec, NULL}, 23 | {(FontSpec*)&ProfilerFontSpec, NULL}, 24 | {(FontSpec*)&DebugFontSpec, NULL}, 25 | {% if itemNames %} 26 | {%- for itemName in itemNames | sort -%} 27 | {(FontSpec*)&{{ itemName }}FontSpec, NULL}, 28 | {% endfor -%} 29 | {% endif %} 30 | {NULL, NULL} 31 | }; -------------------------------------------------------------------------------- /headers/LibVUEngine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef LIBVUENGINE_H_ 11 | #define LIBVUENGINE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #ifndef __SHIPPING 25 | #include 26 | #endif 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | © Jorge Eremiev and Christian Radke 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 4 | associated documentation files (the "Software"), to deal in the Software without restriction, including 5 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to 7 | the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial 10 | portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 13 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 14 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 15 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 16 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | -------------------------------------------------------------------------------- /contributions/Template/ColumnTableSpec.c.njk: -------------------------------------------------------------------------------- 1 | {%- set sanitizedSpecName = itemUri | basename(false) | sanitizeSpecName -%} 2 | 3 | {%- import 'templates/partials/macros.njk' as macros -%} 4 | {% include('templates/partials/fileHeader/fileHeader.c.njk') %} 5 | 6 | {{ macros.sectionHeader('Includes') }} 7 | 8 | #include 9 | 10 | {{ macros.sectionHeader('Definitions') }} 11 | 12 | ColumnTableROMSpec {{ sanitizedSpecName }}ColumnTableSpec = 13 | { 14 | // Mirror spec? 15 | {% if item.mirror %}true{% else %}false{% endif %}, 16 | 17 | // Column table spec 18 | { 19 | {% for x in range(0, 256) -%} 20 | {%- if not (item.mirror and loop.index > 128) -%} 21 | {%- set value = item.values[x] | default([]) -%} 22 | {%- if not (item.mirror and loop.index > 128) -%} 23 | {%- set repeat = value.repeat - 1 | default(15) -%} 24 | {%- set time = value.time - 1 | default(15) -%} 25 | {{- (repeat * 16 + time) | intToHex(2) -}}{{- ', '-}} 26 | {%- if loop.index % 8 == 0 and not (loop.last or (item.mirror and loop.index == 128)) -%} 27 | {{ "\n " }} 28 | {%- endif -%} 29 | {%- endif -%} 30 | {%- endif -%} 31 | {%- endfor %} 32 | } 33 | }; -------------------------------------------------------------------------------- /contributions/Type/RumbleEffect.type: -------------------------------------------------------------------------------- 1 | { 2 | "file": ".rumble", 3 | "schema": { 4 | "title": "Rumble Effect", 5 | "properties": { 6 | "effect": { 7 | "type": "integer", 8 | "default": 1, 9 | "maximum": 123, 10 | "minimum": 1 11 | }, 12 | "frequency": { 13 | "type": "integer", 14 | "default": 160 15 | }, 16 | "sustainPositive": { 17 | "type": "integer", 18 | "maximum": 255, 19 | "minimum": 0, 20 | "default": 255 21 | }, 22 | "sustainNegative": { 23 | "type": "integer", 24 | "maximum": 255, 25 | "minimum": 0, 26 | "default": 255 27 | }, 28 | "overdrive": { 29 | "type": "integer", 30 | "maximum": 126, 31 | "minimum": 0, 32 | "default": 126 33 | }, 34 | "break": { 35 | "type": "integer", 36 | "maximum": 255, 37 | "minimum": 0, 38 | "default": 255 39 | }, 40 | "stopBeforeStarting": { 41 | "type": "boolean", 42 | "default": true 43 | } 44 | }, 45 | "required": [] 46 | }, 47 | "uiSchema": { 48 | "type": "RumbleEffectEditor", 49 | "scope": "#" 50 | }, 51 | "icon": "codicon codicon-screen-full", 52 | "templates": [ 53 | "RumbleEffectSpec", 54 | "RumbleEffects" 55 | ] 56 | } -------------------------------------------------------------------------------- /assets/Fonts.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 6 | // INCLUDES 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | 9 | #include 10 | 11 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 12 | // DEFINITIONS 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | 15 | FontData _fontData[] = 16 | { 17 | {(FontSpec*)&DefaultFontSpec, NULL}, 18 | {(FontSpec*)&ProfilerFontSpec, NULL}, 19 | {(FontSpec*)&DebugFontSpec, NULL}, 20 | 21 | {NULL, NULL} 22 | }; -------------------------------------------------------------------------------- /source/Component/Collider/Box/InverseBox/InverseBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef INVERSE_BOX_H_ 11 | #define INVERSE_BOX_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class InverseBox 24 | /// 25 | /// Inherits from Collider 26 | /// 27 | /// Defines a collider with the shape of a box that detects collision outside of it. 28 | class InverseBox : Box 29 | { 30 | /// @publicsection 31 | 32 | /// Class' constructor 33 | void constructor(Entity owner, const ColliderSpec* colliderSpec); 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /headers/Fonts.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #ifndef FONTS_H_ 6 | #define FONTS_H_ 7 | 8 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 9 | // INCLUDES 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | 12 | #include 13 | #include 14 | 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | // DECLARATIONS 17 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 18 | 19 | extern FontSpec DefaultFontSpec; 20 | extern FontSpec ProfilerFontSpec; 21 | extern FontSpec DebugFontSpec; 22 | extern FontSpec DebugFontSpec; 23 | extern FontSpec DefaultFontSpec; 24 | extern FontSpec ProfilerFontSpec; 25 | 26 | #endif -------------------------------------------------------------------------------- /assets/BrightnessRepeat/Converted/DefaultBrightnessRepeatSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 6 | // INCLUDES 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | 9 | #include 10 | 11 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 12 | // DEFINITIONS 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | 15 | BrightnessRepeatROMSpec DefaultBrightnessRepeatSpec = 16 | { 17 | // Mirror spec? 18 | true, 19 | 20 | // Brightness repeat values 21 | { 22 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25 | } 26 | }; -------------------------------------------------------------------------------- /source/State/GameState/ToolState/DebugState/DebugState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef DEBUG_STATE_H_ 11 | #define DEBUG_STATE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class DebugState 24 | /// 25 | /// Inherits from ToolState 26 | /// 27 | /// Implements a tool state to display various debug information. 28 | singleton class DebugState : ToolState 29 | { 30 | /// @publicsection 31 | 32 | /// Check if the provided user input unlocks the tool managed by this state. 33 | /// @return True if the input matches the combination defined by the state 34 | override bool isKeyCombination(const UserInput* userInput); 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /lib/utilities/padder_linux.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char **argv) { 6 | unsigned long total; 7 | unsigned int i,filesize,headsize; 8 | unsigned char *pad; 9 | char *str; 10 | FILE *fp,*fpAux; 11 | if ((argc != 2)) { 12 | if ((str = strrchr(argv[0],'\\'))) str++; //filter directori 13 | else str = argv[0]; 14 | printf("Usage: %s ",str); 15 | return 1; } 16 | 17 | if (!(fp = fopen(argv[1],"a+b"))) { 18 | printf("Cannot open \"%s\"\n",argv[1]); 19 | return 1; 20 | } 21 | //put pointer to the end of ROM 22 | fseek(fp,0,SEEK_END); 23 | //create an auxiliary fp 24 | fpAux=fopen(argv[1],"a+b"); 25 | //move auxFp to the end of ROM 26 | fseek(fpAux,0,SEEK_END); 27 | //move auxFp up 5to the end of ROM 28 | fseek(fpAux,-544,SEEK_CUR); 29 | filesize = ftell(fp); 30 | if(filesize > 1048032){ 31 | total= 1048032 - filesize; 32 | } 33 | else{ 34 | total= 1048032 * 2 - filesize; 35 | } 36 | if (!(pad = (unsigned char*)malloc(total))) { 37 | printf("Cannot allocate memory!\n"); 38 | return 1; 39 | } 40 | memset(pad,0xFF,total); 41 | fwrite(pad,1,total,fp); 42 | { 43 | int count=0; 44 | unsigned short buffer=0; 45 | do{ 46 | fread(&buffer, sizeof(buffer), 1,fpAux); 47 | fwrite(&buffer,sizeof(buffer), 1,fp); 48 | }while(count++ < 543/2); 49 | 50 | } 51 | 52 | fclose(fp); 53 | fclose(fpAux); 54 | printf("Completed padding to %d bytes, %d bytes added\n",total+filesize,total); 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /source/State/GameState/ToolState/StageEditorState/StageEditorState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef STAGE_EDITOR_STATE_H_ 11 | #define STAGE_EDITOR_STATE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class StageEditorState 24 | /// 25 | /// Inherits from ToolState 26 | /// 27 | /// Implements a tool state to manipulate stages. 28 | singleton class StageEditorState : ToolState 29 | { 30 | /// @publicsection 31 | 32 | /// Check if the provided user input unlocks the tool managed by this state. 33 | /// @return True if the input matches the combination defined by the state 34 | override bool isKeyCombination(const UserInput* userInput); 35 | } 36 | 37 | #endif -------------------------------------------------------------------------------- /source/State/GameState/ToolState/AnimationInspectorState/AnimationInspectorState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef ANIMATION_INSPECTOR_STATE_H_ 11 | #define ANIMATION_INSPECTOR_STATE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class AnimationInspectorState 24 | /// 25 | /// Inherits from ToolState 26 | /// 27 | /// Implements a tool state to inspect animations. 28 | singleton class AnimationInspectorState : ToolState 29 | { 30 | /// @publicsection 31 | 32 | /// Check if the provided user input unlocks the tool managed by this state. 33 | /// @return True if the input matches the combination defined by the state 34 | override bool isKeyCombination(const UserInput* userInput); 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /source/Misc/Math/Scale.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | 16 | #include "Scale.h" 17 | 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | // CLASS' PUBLIC STATIC METHODS 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | #ifndef __SHIPPING 25 | static inline void Scale::print(Scale scale, int32 x, int32 y) 26 | { 27 | PRINT_TEXT("x: ", x, y); 28 | PRINT_TEXT("y: ", x, y + 1); 29 | PRINT_TEXT("z: ", x, y + 2); 30 | 31 | PRINT_FLOAT(__FIX7_9_TO_F(scale.x), x + 2, y); 32 | PRINT_FLOAT(__FIX7_9_TO_F(scale.y), x + 2, y + 1); 33 | PRINT_FLOAT(__FIX7_9_TO_F(scale.z), x + 2, y + 2); 34 | } 35 | #endif 36 | 37 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 38 | -------------------------------------------------------------------------------- /source/State/GameState/ToolState/SoundTestState/SoundTestState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef SOUND_TEST_STATE_H_ 11 | #define SOUND_TEST_STATE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class SoundTestState 24 | /// 25 | /// Inherits from ToolState 26 | /// 27 | /// Implements a tool state to test sounds. 28 | singleton class SoundTestState : ToolState 29 | { 30 | /// @publicsection 31 | 32 | /// Prepares the object to enter this state. 33 | /// @param owner: Object that is entering in this state 34 | override void enter(void* owner); 35 | 36 | /// Check if the provided user input unlocks the tool managed by this state. 37 | /// @return True if the input matches the combination defined by the state 38 | override bool isKeyCombination(const UserInput* userInput); 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /source/Misc/Math/Rotation.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | 16 | #include "Rotation.h" 17 | 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | // CLASS' PUBLIC STATIC METHODS 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | #ifndef __SHIPPING 25 | static inline void Rotation::print(Rotation rotation, int32 x, int32 y) 26 | { 27 | PRINT_TEXT("x: ", x, y); 28 | PRINT_TEXT("y: ", x, y + 1); 29 | PRINT_TEXT("z: ", x, y + 2); 30 | 31 | PRINT_FLOAT(__FIXED_TO_F(rotation.x), x + 2, y); 32 | PRINT_FLOAT(__FIXED_TO_F(rotation.y), x + 2, y + 1); 33 | PRINT_FLOAT(__FIXED_TO_F(rotation.z), x + 2, y + 2); 34 | } 35 | #endif 36 | 37 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 38 | -------------------------------------------------------------------------------- /source/Misc/Math/PixelVector.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | 16 | #include "PixelVector.h" 17 | 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | // CLASS' PUBLIC STATIC METHODS 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | #ifndef __SHIPPING 25 | static inline void PixelVector::print(PixelVector vector, int32 x, int32 y) 26 | { 27 | PRINT_TEXT("x: ", x, y); 28 | PRINT_TEXT("y: ", x, y + 1); 29 | PRINT_TEXT("z: ", x, y + 2); 30 | PRINT_TEXT("p: ", x, y + 3); 31 | 32 | PRINT_INT(vector.x, x + 2, y); 33 | PRINT_INT(vector.y, x + 2, y + 1); 34 | PRINT_INT(vector.z, x + 2, y + 2); 35 | PRINT_INT(vector.parallax, x + 2, y + 3); 36 | } 37 | #endif 38 | 39 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 40 | -------------------------------------------------------------------------------- /headers/WaveForms.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #ifndef WAVEFORMS_H_ 6 | #define WAVEFORMS_H_ 7 | 8 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 9 | // INCLUDES 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | 12 | #include 13 | 14 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 15 | // DECLARATIONS 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | 18 | extern const WaveformData GlockenWaveForm; 19 | extern const WaveformData OrganWaveForm; 20 | extern const WaveformData PianoWaveForm; 21 | extern const WaveformData RolandWaveForm; 22 | extern const WaveformData SawWaveForm; 23 | extern const WaveformData SawSquareWaveForm; 24 | extern const WaveformData SineWaveForm; 25 | extern const WaveformData SinePlusAlphaWaveForm; 26 | extern const WaveformData SquareWaveForm; 27 | extern const WaveformData SquareDuty75WaveForm; 28 | extern const WaveformData TriangleWaveForm; 29 | extern const WaveformData TrumpetWaveForm; 30 | extern const WaveformData ViolinWaveForm; 31 | 32 | #endif -------------------------------------------------------------------------------- /lib/compiler/preprocessor/processGCCOutput.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | 4 | while [ $# -gt 1 ] 5 | do 6 | key="$1" 7 | case $key in 8 | -o) 9 | OUTPUT_FILE="$2" 10 | shift # past argument 11 | ;; 12 | -w) 13 | WORKING_FOLDER="$2" 14 | shift # past argument 15 | ;; 16 | -p) 17 | PLUGINS="$2" 18 | shift # past argument 19 | ;; 20 | -l) 21 | PLUGINS_PATH="$2" 22 | shift # past argument 23 | ;; 24 | -n) 25 | NAME="$2" 26 | shift # past argument 27 | ;; 28 | -h) 29 | NAME_HOME="$2" 30 | shift # past argument 31 | ;; 32 | esac 33 | 34 | shift 35 | done 36 | 37 | GCC_OUTPUT=$OUTPUT_FILE.out 38 | 39 | # Check to see if a pipe exists on stdin. 40 | if [ -p /dev/stdin ]; then 41 | # If we want to read the input line by line 42 | while IFS= read line; do 43 | echo "${line}" >> $GCC_OUTPUT 44 | done 45 | else 46 | exit 0 47 | fi 48 | 49 | if [ ! -f "$GCC_OUTPUT" ]; 50 | then 51 | exit 0 52 | fi 53 | 54 | 55 | if [ ! -d "$WORKING_FOLDER" ]; 56 | then 57 | rm -f $GCC_OUTPUT 58 | exit 0 59 | fi 60 | 61 | if [ -z "$PLUGINS" ] && [ -z "$NAME" ] && [ -z "$NAME_HOME" ]; 62 | then 63 | rm -f $GCC_OUTPUT 64 | exit 0 65 | fi 66 | 67 | for plugin in $PLUGINS; 68 | do 69 | pattern=^.*build/working/objects/[a-z][a-z]*/$objects/ 70 | replacement=$PLUGINS_PATH/$plugin/ 71 | sed -e 's@'"$pattern"'@'"$replacement"'@g' $GCC_OUTPUT > $GCC_OUTPUT.tmp 72 | mv $GCC_OUTPUT.tmp $GCC_OUTPUT 73 | done 74 | 75 | replacement=$NAME_HOME 76 | pattern=^.*build/working/objects/[a-z][a-z]*/$NAME 77 | 78 | if [[ $PLUGINS_PATH == *"/mnt/"* ]]; then 79 | sed -e 's@'"$pattern"'@'"$replacement"'@g' $GCC_OUTPUT | sed -E 's@/mnt/([A-z]+)/@\1:/@g' | sed -e 's@/@\\@g' 80 | else 81 | sed -e 's@'"$pattern"'@'"$replacement"'@g' $GCC_OUTPUT 82 | fi 83 | 84 | echo 85 | rm -f $GCC_OUTPUT 86 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Sprite/Texture/ObjectTexture/ObjectTexture.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include "ObjectTexture.h" 15 | 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | // CLASS' PUBLIC METHODS 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | void ObjectTexture::constructor(const ObjectTextureSpec* objectTextureSpec, uint16 id) 23 | { 24 | // Always explicitly call the base's constructor 25 | Base::constructor((TextureSpec*)objectTextureSpec, id); 26 | } 27 | 28 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 29 | 30 | void ObjectTexture::destructor() 31 | { 32 | // Always explicitly call the base's destructor 33 | Base::destructor(); 34 | } 35 | 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | -------------------------------------------------------------------------------- /source/Debugging/Error/Error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef ERROR_H_ 11 | #define ERROR_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class Error 24 | /// 25 | /// Inherits from Object 26 | /// 27 | /// Catches assertions and hardware exceptions. 28 | static class Error : Object 29 | { 30 | /// @publicsection 31 | 32 | /// Locks the program in a screen with the details of what caused the exception. 33 | /// @param message: Pointer to a brief description of the exception 34 | /// @param detail: Pointer to a detailed description of the exception 35 | static void triggerException(char* message, char* detail); 36 | 37 | /// Handles hardware's zero division exception. 38 | static void zeroDivisionException(); 39 | 40 | /// Handles hardware's invalid opcode exception. 41 | static void invalidOpcodeException(); 42 | 43 | /// Handles hardware's floating point exception. 44 | static void floatingPointException(); 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /contributions/Template/ActorImageData.c.njk: -------------------------------------------------------------------------------- 1 | {%- import 'templates/partials/macros.njk' as macros -%} 2 | {%- include('templates/partials/fileHeader/fileHeader.c.njk') -%} 3 | 4 | {%- set sanitizedSpecName = itemUri | basename(false) | sanitizeSpecName -%} 5 | {%- set section = sprite.section -%} 6 | {%- set compression = sprite.compression -%} 7 | 8 | {%- set frameCount = item.animations.totalFrames -%} 9 | {%- set isAnimation = item.components.animations | length > 0 -%} 10 | {%- set mostSpritesOnAFile = 0 -%} 11 | {% for sprite in item.components.sprites -%} 12 | {%- if sprite.texture.files | length > mostSpritesOnAFile -%} 13 | {%- set mostSpritesOnAFile = sprite.texture.files | length -%} 14 | {%- endif -%} 15 | {%- endfor -%} 16 | {%- set isMultifileAnimation = mostSpritesOnAFile > 1 -%} 17 | 18 | {%- set isSpritesheetAnimation = false -%} 19 | {%- if isAnimation and not isMultifileAnimation and frameCount > 0 -%} 20 | {%- set isSpritesheetAnimation = true -%} 21 | {%- endif -%} 22 | 23 | {%- if item.components.sprites | length %} 24 | {% for sprite in item.components.sprites -%} 25 | {%- if not sprite._imageData | int and sprite._imageData.images | length -%} 26 | {%- for imageData in sprite._imageData.images -%} 27 | {%- set tilesName = sanitizedSpecName ~ 'Actor' ~ imageData.tiles.name -%} 28 | {%- set customMapPrefix = sanitizedSpecName ~ 'Actor' -%} 29 | {#- for some reason, the uncompressJson filter in below partials wouldn't work if we don't call it here once -#} 30 | {%- set __whatTheHeck__ = imageData.tiles.data | uncompressJson -%} 31 | {%- include('templates/partials/image/tiles.c.njk') -%} 32 | {%- include('templates/partials/image/maps.c.njk') -%} 33 | {%- include('templates/partials/image/frameOffsets.c.njk') -%} 34 | {%- endfor -%} 35 | {%- endif -%} 36 | {%- endfor -%} 37 | {%- endif -%} -------------------------------------------------------------------------------- /contributions/Template/RumbleEffectSpec.c.njk: -------------------------------------------------------------------------------- 1 | {%- set sanitizedSpecName = itemUri | basename(false) | sanitizeSpecName -%} 2 | 3 | {%- import 'templates/partials/macros.njk' as macros -%} 4 | {% include('templates/partials/fileHeader/fileHeader.c.njk') %} 5 | 6 | {{ macros.sectionHeader('Includes') }} 7 | 8 | #include 9 | 10 | {{ macros.sectionHeader('Definitions') }} 11 | 12 | RumbleEffectROMSpec {{ sanitizedSpecName }}RumbleEffectSpec = 13 | { 14 | // Effect # 15 | {% if item.effect >= 1 and item.effect <= 123 -%} 16 | {{ item.effect }} 17 | {%- else -%} 18 | 1 19 | {%- endif %}, 20 | // Frequency 21 | {% if item.frequency == 50 -%} 22 | __RUMBLE_FREQ_50HZ, 23 | {% elseif item.frequency == 95 -%} 24 | __RUMBLE_FREQ_95HZ, 25 | {% elseif item.frequency == 130 -%} 26 | __RUMBLE_FREQ_130HZ, 27 | {% elseif item.frequency == 240 -%} 28 | __RUMBLE_FREQ_240HZ, 29 | {%- elseif item.frequency == 320 -%} 30 | __RUMBLE_FREQ_320HZ, 31 | {%- elseif item.frequency == 400 -%} 32 | __RUMBLE_FREQ_400HZ, 33 | {%- else -%} 34 | __RUMBLE_FREQ_160HZ, 35 | {%- endif %} 36 | // Positive Sustain 37 | {% if item.sustainPositive >= 0 and item.sustainPositive <= 255 -%} 38 | {{ item.sustainPositive }} 39 | {%- else -%} 40 | 255 41 | {%- endif %}, 42 | // Negative Sustain 43 | {% if item.sustainNegative >= 0 and item.sustainNegative <= 255 -%} 44 | {{ item.sustainNegative }} 45 | {%- else -%} 46 | 255 47 | {%- endif %}, 48 | // Overdrive 49 | {% if item.overdrive >= 0 and item.overdrive <= 126 -%} 50 | {{ item.overdrive }} 51 | {%- else -%} 52 | 126 53 | {%- endif %}, 54 | // Break 55 | {% if item.break >= 0 and item.break <= 255 -%} 56 | {{ item.break }} 57 | {%- else -%} 58 | 255 59 | {%- endif %}, 60 | // Stop before starting 61 | {% if item.stopBeforeStarting %}true{% else %}false{% endif %}, 62 | }; 63 | -------------------------------------------------------------------------------- /source/Misc/Math/Vector2D.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | 16 | #include "Vector2D.h" 17 | 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | // CLASS' PUBLIC STATIC METHODS 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | #ifndef __SHIPPING 25 | static inline void Vector2D::print(Vector2D vector, int32 x, int32 y) 26 | { 27 | PRINT_TEXT("x: ", x, y); 28 | PRINT_TEXT("y: ", x, y + 1); 29 | 30 | PRINT_FLOAT(__FIXED_TO_F(vector.x), x + 2, y); 31 | PRINT_FLOAT(__FIXED_TO_F(vector.y), x + 2, y + 1); 32 | } 33 | #endif 34 | 35 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 36 | 37 | #ifndef __SHIPPING 38 | static inline void Vector2D::printRaw(Vector2D vector, int32 x, int32 y) 39 | { 40 | PRINT_TEXT("x: ", x, y); 41 | PRINT_TEXT("y: ", x, y + 1); 42 | 43 | PRINT_INT((vector.x), x + 2, y); 44 | PRINT_INT((vector.y), x + 2, y + 1); 45 | } 46 | #endif 47 | 48 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 49 | -------------------------------------------------------------------------------- /source/Misc/Time/Stopwatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef STOPWATCH_H_ 11 | #define STOPWATCH_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class Stopwatch 24 | /// 25 | /// Inherits from ListenerObject 26 | /// 27 | /// Implements a stopwatch to keep track of time passage. 28 | class Stopwatch : ListenerObject 29 | { 30 | /// @protectedsection 31 | 32 | /// Elapsed time in milliseconds 33 | uint32 milliSeconds; 34 | 35 | /// Interrupts counter 36 | uint32 interrupts; 37 | 38 | /// Timer counter's configuration value 39 | uint32 timerCounter; 40 | 41 | /// Last registered timer counter's configuration value 42 | uint32 previousTimerCounter; 43 | 44 | /// Ratio between elapsed time per interrupt and timer counter's value 45 | float timeProportion; 46 | 47 | /// @publicsection 48 | 49 | /// Class' constructor 50 | void constructor(); 51 | 52 | /// Class' destructor 53 | void destructor(); 54 | 55 | /// Reset the state of the stopwatch. 56 | void reset(); 57 | 58 | /// Update the state of the stopwatch. 59 | void update(); 60 | 61 | /// Register a new lap. 62 | /// @return Elapsed time during the last lap 63 | float lap(); 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /source/Debugging/Tool/SoundTest/SoundTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef SOUND_TEST_H_ 11 | #define SOUND_TEST_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | // CLASS' DECLARATION 23 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 24 | 25 | /// Class SoundTest 26 | /// 27 | /// Inherits from Tool 28 | /// 29 | /// Implements a tool to test sounds. 30 | singleton class SoundTest : Tool 31 | { 32 | /// Currently tested sound 33 | Sound sound; 34 | 35 | /// Index of the selected sound 36 | uint16 soundIndex; 37 | 38 | /// @publicsection 39 | 40 | /// Process an event that the instance is listen for. 41 | /// @param eventFirer: ListenerObject that signals the event 42 | /// @param eventCode: Code of the firing event 43 | /// @return False if the listener has to be removed; true to keep it 44 | override bool onEvent(ListenerObject eventFirer, uint16 eventCode); 45 | 46 | /// Update the tool's state. 47 | override void update(); 48 | 49 | /// Show the tool. 50 | override void show(); 51 | 52 | /// Hide the tool. 53 | override void hide(); 54 | 55 | /// Process the provided user pressed key. 56 | /// @param pressedKey: User pressed key 57 | override void processUserInput(uint16 pressedKey); 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /source/Misc/Time/StopwatchManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef STOPWATCH_MANAGER_H_ 11 | #define STOPWATCH_MANAGER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // FORWARD DECLARATIONS 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | class Stopwatch; 24 | 25 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 26 | // CLASS' DECLARATION 27 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 28 | 29 | /// Class StopwatchManager 30 | /// 31 | /// Inherits from Object 32 | /// 33 | /// Manages the instances of Stopwatch. 34 | singleton class StopwatchManager : Object 35 | { 36 | /// @protectedsection 37 | 38 | // Linked list of Stopwatches 39 | VirtualList stopwatches; 40 | 41 | /// @publicsection 42 | 43 | /// Reset all the registered stopwatches. 44 | void reset(); 45 | 46 | /// Register a new stopwatch 47 | /// @param clock: Stopwatch to register 48 | void register(Stopwatch clock); 49 | 50 | /// Unregister stopwatch. 51 | /// @param clock: Stopwatch to unregister 52 | void unregister(Stopwatch clock); 53 | 54 | /// Update the stopwatches. 55 | void update(); 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /source/Misc/Lists/VirtualNode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef VIRTUAL_NODE_H_ 11 | #define VIRTUAL_NODE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class VirtualNode 24 | /// 25 | /// Inherits from Object 26 | /// 27 | /// Implements an element of linked lists. 28 | class VirtualNode : Object 29 | { 30 | /// @protectedsection 31 | 32 | /// Pointer to the next node in the linked list 33 | VirtualNode next; 34 | 35 | /// Pointer to the previous node in the linked list 36 | VirtualNode previous; 37 | 38 | /// Pointer to the data 39 | void* data; 40 | 41 | /// @publicsection 42 | 43 | /// Class' constructor 44 | /// @param data: Pointer to the data hold by this node 45 | void constructor(const void* const data); 46 | 47 | /// Retrieve the pointer to the data. 48 | /// @return Pointer to the data 49 | void* getData(); 50 | 51 | /// Retrieve the next node in the linked list. 52 | /// @return Next node in the linked list 53 | VirtualNode getNext(); 54 | 55 | /// Retrieve the previous node in the linked list. 56 | /// @return Previous node in the linked list 57 | VirtualNode getPrevious(); 58 | 59 | /// Swap the data with another node 60 | /// @param node: Node to swap data with 61 | void swapData(VirtualNode node); 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /source/Component/Collider/Box/InverseBox/InverseBox.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include "InverseBox.h" 15 | 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | // CLASS' DECLARATIONS 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | 20 | friend class Box; 21 | 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | // CLASS' PUBLIC METHODS 24 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 25 | 26 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 27 | 28 | void InverseBox::constructor(Entity owner, const ColliderSpec* colliderSpec) 29 | { 30 | // Always explicitly call the base's constructor 31 | Base::constructor(owner, colliderSpec); 32 | 33 | this->classIndex = kColliderInverseBoxIndex; 34 | } 35 | 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | 38 | void InverseBox::destructor() 39 | { 40 | // Always explicitly call the base's destructor 41 | Base::destructor(); 42 | } 43 | 44 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 45 | -------------------------------------------------------------------------------- /source/Misc/Time/ClockManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef CLOCK_MANAGER_H_ 11 | #define CLOCK_MANAGER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // FORWARD DECLARATIONS 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | class VirtualList; 24 | class Clock; 25 | 26 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 27 | // CLASS' DECLARATION 28 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 29 | 30 | /// Class ClockManager 31 | /// 32 | /// Inherits from Object 33 | /// 34 | /// Manages the instances of Clock. 35 | singleton class ClockManager : Object 36 | { 37 | /// @protectedsection 38 | 39 | /// Linked list of Clocks 40 | VirtualList clocks; 41 | 42 | /// @publicsection 43 | 44 | /// Reset all the registered clocks. 45 | void reset(); 46 | 47 | /// Register a new clock 48 | /// @param clock: Clock to register 49 | void register(Clock clock); 50 | 51 | /// Unregister clock. 52 | /// @param clock: Clock to unregister 53 | void unregister(Clock clock); 54 | 55 | /// Update the clocks. 56 | /// @param elapsedMilliseconds: Milliseconds that passed since the previous call to this method 57 | void update(uint32 elapsedMilliseconds); 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /source/Entity/Container/UIContainer/UIContainer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef UI_CONTAINER_H_ 11 | #define UI_CONTAINER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // CLASS' DECLARATION 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | /// Class UIContainer 25 | /// 26 | /// Inherits from Container 27 | /// 28 | /// Implements a container whose children are always fixed to the camera 29 | class UIContainer : Container 30 | { 31 | /// @publicsection 32 | 33 | /// Class' constructor 34 | /// @param childrenPositionedActors: Array of specs that define how to configure the container's children 35 | void constructor(PositionedActor* childrenPositionedActors); 36 | 37 | /// Compute the container's global transformation. 38 | /// @param environmentTransform: Reference environment for the local transformation 39 | /// @param invalidateTransformationFlag: Flag that determines which transfomation's components 40 | /// must be recomputed 41 | override void transform(const Transformation* environmentTransform, uint8 invalidateTransformationFlag); 42 | 43 | /// Spawn a new child and configure it with the provided positioned actor struct. 44 | /// @param positionedActor: Struct that defines which actor spec to use to configure the new child 45 | Actor spawnChildActor(const PositionedActor* const positionedActor); 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /source/Component/Mutator/MutatorManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef MUTATOR_MANAGER_H_ 11 | #define MUTATOR_MANAGER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | // CLASS' DECLARATION 23 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 24 | 25 | /// Class MutatorManager 26 | /// 27 | /// Inherits from ComponentManager 28 | /// 29 | /// Manages all the mutator instances. 30 | class MutatorManager : ComponentManager 31 | { 32 | /// @protectedsection 33 | 34 | /// @publicsection 35 | 36 | /// Class' constructor 37 | void constructor(); 38 | 39 | /// Retrieve the compoment type that the manager manages. 40 | /// @return Component type 41 | override uint32 getType(); 42 | 43 | /// Enable the manager. 44 | override void enable(); 45 | 46 | /// Disable the manager. 47 | override void disable(); 48 | 49 | /// Create a mutator with the provided spec. 50 | /// @param owner: Object to which the mutator will attach to 51 | /// @param mutatorSpec: Spec to use to create the mutator 52 | /// @return Created mutator 53 | override Mutator create(Entity owner, const MutatorSpec* mutatorSpec); 54 | 55 | /// Destroy the provided mutator 56 | /// Reset the manager's state 57 | void reset(); 58 | 59 | /// Update the registered bodies by advancing the physics simulations. 60 | void update(); 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /source/Component/Behavior/BehaviorManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef BEHAVIOR_MANAGER_H_ 11 | #define BEHAVIOR_MANAGER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | // CLASS' DECLARATION 23 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 24 | 25 | /// Class BehaviorManager 26 | /// 27 | /// Inherits from ComponentManager 28 | /// 29 | /// Manages all the behavior instances. 30 | class BehaviorManager : ComponentManager 31 | { 32 | /// @protectedsection 33 | 34 | /// @publicsection 35 | 36 | /// Class' constructor 37 | void constructor(); 38 | 39 | /// Retrieve the compoment type that the manager manages. 40 | /// @return Component type 41 | override uint32 getType(); 42 | 43 | /// Enable the manager. 44 | override void enable(); 45 | 46 | /// Disable the manager. 47 | override void disable(); 48 | 49 | /// Create a behavior with the provided spec. 50 | /// @param owner: Object to which the behavior will attach to 51 | /// @param behaviorSpec: Spec to use to create the behavior 52 | /// @return Created behavior 53 | override Behavior create(Entity owner, const BehaviorSpec* behaviorSpec); 54 | 55 | /// Destroy the provided behavior 56 | /// Reset the manager's state 57 | void reset(); 58 | 59 | /// Update the registered bodies by advancing the physics simulations. 60 | void update(); 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /source/Component/Collider/CollisionTester.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef COLLISION_TESTER_H_ 11 | #define COLLISION_HELPER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // FORWARD DECLARATIONS 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | class Collider; 25 | 26 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 27 | // CLASS' DECLARATION 28 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 29 | 30 | /// Class CollisionTester 31 | /// 32 | /// Inherits from Object 33 | /// 34 | /// Implements collisions tests between two colliders. 35 | static class CollisionTester : Object 36 | { 37 | /// @publicsection 38 | 39 | /// Check if the provided colliders are overlaping each other. 40 | /// @param requesterCollider: Collider asking for the test 41 | /// @param otherCollider: Collider against which to test the overlaping 42 | /// @param collisionInformation: Struct holding the information with the results of the test 43 | /// @param sizeDelta: Delta to add to the collider's size 44 | static void testOverlaping 45 | ( 46 | Collider requesterCollider, Collider otherCollider, CollisionInformation* collisionInformation, fixed_t sizeDelta 47 | ); 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /source/Misc/Math/Vector3D.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | 16 | #include "Vector3D.h" 17 | 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | // CLASS' PUBLIC STATIC METHODS 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | #ifndef __SHIPPING 25 | static inline void Vector3D::print(Vector3D vector, int32 x, int32 y) 26 | { 27 | PRINT_TEXT("x: ", x, y); 28 | PRINT_TEXT("y: ", x, y + 1); 29 | PRINT_TEXT("z: ", x, y + 2); 30 | 31 | PRINT_FLOAT(__FIXED_TO_F(vector.x), x + 2, y); 32 | PRINT_FLOAT(__FIXED_TO_F(vector.y), x + 2, y + 1); 33 | PRINT_FLOAT(__FIXED_TO_F(vector.z), x + 2, y + 2); 34 | } 35 | #endif 36 | 37 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 38 | 39 | #ifndef __SHIPPING 40 | static inline void Vector3D::printRaw(Vector3D vector, int32 x, int32 y) 41 | { 42 | PRINT_TEXT("x: ", x, y); 43 | PRINT_TEXT("y: ", x, y + 1); 44 | PRINT_TEXT("z: ", x, y + 2); 45 | 46 | PRINT_INT((vector.x), x + 2, y); 47 | PRINT_INT((vector.y), x + 2, y + 1); 48 | PRINT_INT((vector.z), x + 2, y + 2); 49 | } 50 | #endif 51 | 52 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 53 | -------------------------------------------------------------------------------- /lib/compiler/make/makefile-preprocess: -------------------------------------------------------------------------------- 1 | # Engine name 2 | override ENGINE_NAME = core 3 | 4 | # Engine's home 5 | override ENGINE_HOME = $(ENGINE_FOLDER) 6 | 7 | # List of header files. 8 | HEADERS_DIRS = $(shell find $(MY_HOME)/source -type d -print) 9 | HEADERS_DIRS := $(HEADERS_DIRS) $(shell find $(MY_HOME)/headers -type d -print) 10 | HEADERS_DIRS_CLEAN = $(shell echo $(HEADERS_DIRS) | sed -e 's@'"$(MY_HOME)"/'@@g') 11 | HEADERS = $(foreach DIR,$(HEADERS_DIRS),$(wildcard $(DIR)/*.h)) 12 | 13 | # Makes a list of the header files that will have to be created. 14 | WORKING_FOLDER_CLEAR = $(GAME_HOME)/$(shell echo $(WORKING_FOLDER) | sed -e 's@'"$(GAME_HOME)"/'@@g') 15 | H_FILES_TEMP = $(shell echo $(HEADERS) | sed -e 's@'"$(WORKING_FOLDER)"/'@@g' -e 's@'"$(MY_HOME)"/'@@g') 16 | H_FILES = $(addprefix $(WORKING_FOLDER_CLEAR)/headers/$(NAME)/, $(H_FILES_TEMP:.h=.h)) 17 | 18 | D_FILES = $(shell if [ -d $(WORKING_FOLDER)/classes/dependencies/$(NAME) ]; then find $(WORKING_FOLDER)/classes/dependencies/$(NAME) -name "*.d"; fi; ) 19 | 20 | # Class setup file 21 | SETUP_CLASSES = $(BASENAME)SetupClasses 22 | SETUP_CLASSES_SOURCE = $(WORKING_FOLDER)/objects/$(BUILD_MODE)/$(NAME)/$(SETUP_CLASSES) 23 | 24 | preprocess: phony $(SETUP_CLASSES_SOURCE).c 25 | @$(shell echo "$(D_FILES)" > $(WORKING_FOLDER)/classes/dependencies/$(BASENAME).dependencies.txt ) 26 | 27 | PLUGINS_ARGUMENT=$(addprefix -l , $(PLUGINS:.=.)) 28 | 29 | # Override makefile's below dependencies for header files so proper propagation of changes in base classes are catched up 30 | -include $(D_FILES) 31 | 32 | $(WORKING_FOLDER_CLEAR)/headers/$(NAME)/%.h: $(MY_HOME)/%.h 33 | @bash $(ENGINE_HOME)/lib/compiler/preprocessor/processHeaderFile.sh -e $(ENGINE_HOME) -i $< -o $@ -m $(GAME_HOME) -w $(WORKING_FOLDER) -c $(CLASSES_HIERARCHY_FILE) -n $(NAME) -h $(MY_HOME) -p $(PLUGINS_FOLDER) -u $(USER_PLUGINS_FOLDER) -g makefile -x $(GAME_NAME) $(PLUGINS_ARGUMENT) 34 | 35 | $(SETUP_CLASSES_SOURCE).c: $(H_FILES) 36 | @bash $(ENGINE_HOME)/lib/compiler/preprocessor/setupClasses.sh -n $(SETUP_CLASSES) -c $(CLASSES_HIERARCHY_FILE) -o $(SETUP_CLASSES_SOURCE).c -w $(WORKING_FOLDER) -b $(BUILD_MODE) 37 | 38 | phony: 39 | @echo > /dev/null 40 | 41 | -------------------------------------------------------------------------------- /source/Misc/Math/PixelSize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef PIXEL_SIZE_H_ 11 | #define PIXEL_SIZE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class PixelSize 24 | /// 25 | /// Inherits from Object 26 | /// 27 | /// Implements methods to operate on PixelSize structs. 28 | static class PixelSize : Object 29 | { 30 | /// @publicsection 31 | 32 | /// Convert a Size struct to a PixelSize one. 33 | /// @param size: Size struct to convert 34 | /// @return PixelSize struct 35 | static inline PixelSize getFromSize(Size size); 36 | } 37 | 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | // CLASS' PUBLIC STATIC METHODS 40 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 41 | 42 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 43 | 44 | static inline PixelSize PixelSize::getFromSize(Size size) 45 | { 46 | return (PixelSize) 47 | { 48 | __METERS_TO_PIXELS(size.x), 49 | __METERS_TO_PIXELS(size.y), 50 | __METERS_TO_PIXELS(size.z) 51 | }; 52 | } 53 | 54 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Sprite/Texture/ObjectTexture/ObjectTextureManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef OBJECT_TEXTURE_MANAGER_H_ 11 | #define OBJECT_TEXTURE_MANAGER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // CLASS' DECLARATION 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | /// Class BgmapTextureManager 25 | /// 26 | /// Inherits from Texture 27 | /// 28 | /// Manages textures for OBJECT space. 29 | singleton class ObjectTextureManager : Object 30 | { 31 | // List of textures with BGMAP space allocated for them 32 | VirtualList objectTextures; 33 | 34 | /// @publicsection 35 | 36 | /// Reset the manager's state. 37 | void reset(); 38 | 39 | /// Update texture pending rewriting of data in DRAM. 40 | /// @param maximumTextureRowsToWrite: Number of texture rows to write during this call 41 | /// @param defer: If true, the texture data is written overtime; otherwise 42 | /// all is written in a single pass 43 | void updateTextures(int16 maximumTextureRowsToWrite, bool defer); 44 | 45 | /// Retrieve a texture initialized with the provided spec. 46 | /// @param objectTextureSpec: Spec to use to initilize the desired texture 47 | /// @return Texture initialized with the provided spec 48 | ObjectTexture getTexture(ObjectTextureSpec* objectTextureSpec); 49 | 50 | /// Release a texture. 51 | /// @param objectTexture: Texture to release 52 | void releaseTexture(ObjectTexture objectTexture); 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /source/Misc/Math/Size.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef SIZE_H_ 11 | #define SIZE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // CLASS' DECLARATION 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | /// Class Size 25 | /// 26 | /// Inherits from Object 27 | /// 28 | /// Implements methods to operate on Size structs. 29 | static class Size : Object 30 | { 31 | /// @publicsection 32 | 33 | /// Convert a PixelSize struct to a Size one. 34 | /// @param pixelSize: PixelSize struct to convert 35 | /// @return Size struct 36 | static inline Size getFromPixelSize(PixelSize pixelSize); 37 | } 38 | 39 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 40 | // CLASS' PUBLIC STATIC METHODS 41 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 42 | 43 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 44 | 45 | static inline Size Size::getFromPixelSize(PixelSize pixelSize) 46 | { 47 | return (Size) 48 | { 49 | __PIXELS_TO_METERS(pixelSize.x), 50 | __PIXELS_TO_METERS(pixelSize.y), 51 | __PIXELS_TO_METERS(pixelSize.z) 52 | }; 53 | } 54 | 55 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /lib/compiler/preprocessor/cleanSyntax.sh: -------------------------------------------------------------------------------- 1 | if [ ! -z "$1" ] && [ ! -z "$2" ] && [ ! -z "$3" ] 2 | then 3 | VUENGINE_HOME=$1 4 | SOURCE_FOLDER=$2 5 | WORKING_FOLDER=$3 6 | 7 | if [ ! -d "$WORKING_FOLDER/preprocessor" ]; 8 | then 9 | mkdir -p $WORKING_FOLDER/preprocessor 10 | fi 11 | 12 | echo "Cleaning $SOURCE_FOLDER" 13 | # find $SOURCE_FOLDER -name "*.h" -exec cp -f {}.txt {} \; 14 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s:__VIRTUAL_CALL(\([A-z0-9]*\), *\([A-z0-9]*\), *\(.*\)*:\1_\2(\3:g" {} \; 15 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s:__CALL_BASE_METHOD([A-z0-9]*, *\([A-z0-9]* *\), *\([A-z0-9]*\), *:Base_\1(\2, :g" {} \; 16 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#__CONSTRUCT_BASE(\(.*\)#Base::constructor(\1)#" {} \; 17 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s:__DESTROY_BASE:Base_destructor():g" {} \; 18 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s:__CLASS_DEFINITION.*::g" {} \; 19 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s:__CLASS_NEW_.*::g" {} \; 20 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s:__SINGLETON(.*::g" {} \; 21 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s:__SINGLETON_.*(.*::g" {} \; 22 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#\([A-Z][A-z0-9]*\)_\([a-z][A-z0-9]*\)#\1::\2#g" {} \; 23 | find $SOURCE_FOLDER -name "*.h" -exec $VUENGINE_HOME/lib/compiler/preprocessor/portHeader.sh {} $WORKING_FOLDER \; 24 | 25 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#__SAFE_CAST(\([A-Z][A-z0-9]*\), #\1::safeCast(#g" {} \; 26 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#([A-Z][A-z0-9]* this)#()#g" {} \; 27 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#([A-Z][A-z0-9]* this, #(#g" {} \; 28 | find $SOURCE_FOLDER -name "*.h" -exec sed -i -e "s#([A-Z][A-z0-9]* this)#()#g" {} \; 29 | find $SOURCE_FOLDER -name "*.h" -exec sed -i -e "s#([A-Z][A-z0-9]* this, #(#g" {} \; 30 | 31 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#__NEW(\([A-Z][A-z0-9]*\),#new \1(#g" {} \; 32 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#__NEW_BASIC(\([A-Z][A-z0-9]*\))#new \1#g" {} \; 33 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#__DELETE(\([A-Z][A-z0-9]*\));#delete \1;#g" {} \; 34 | find $SOURCE_FOLDER -name "*.c" -exec sed -i -e "s#__DELETE_BASIC(\([A-Z][A-z0-9]*\));#delete \1;#g" {} \; 35 | 36 | fi -------------------------------------------------------------------------------- /contributions/Type/Font.type: -------------------------------------------------------------------------------- 1 | { 2 | "file": ".font", 3 | "schema": { 4 | "title": "Font", 5 | "properties": { 6 | "offset": { 7 | "type": "integer", 8 | "default": 0, 9 | "minimum": 0, 10 | "maximum": 255 11 | }, 12 | "characterCount": { 13 | "type": "integer", 14 | "default": 256, 15 | "minimum": 1, 16 | "maximum": 256 17 | }, 18 | "size": { 19 | "type": "object", 20 | "properties": { 21 | "x": { 22 | "type": "integer", 23 | "default": 1, 24 | "minimum": 1, 25 | "maximum": 4 26 | }, 27 | "y": { 28 | "type": "integer", 29 | "default": 1, 30 | "minimum": 1, 31 | "maximum": 4 32 | } 33 | }, 34 | "additionalProperties": false 35 | }, 36 | "variableSize": { 37 | "type": "object", 38 | "properties": { 39 | "enabled": { 40 | "type": "boolean", 41 | "default": false 42 | }, 43 | "x": { 44 | "type": "array", 45 | "items": { 46 | "type": "integer", 47 | "default": 8, 48 | "minimum": 1, 49 | "maximum": 32 50 | }, 51 | "default": [] 52 | }, 53 | "y": { 54 | "type": "integer", 55 | "default": 8, 56 | "minimum": 1, 57 | "maximum": 32 58 | } 59 | }, 60 | "additionalProperties": false 61 | }, 62 | "section": { 63 | "type": "string", 64 | "default": "rom" 65 | }, 66 | "compression": { 67 | "type": "string", 68 | "default": "none" 69 | }, 70 | "pageSize": { 71 | "type": "integer", 72 | "default": 256, 73 | "minimum": 1, 74 | "maximum": 256 75 | }, 76 | "characters": { 77 | "type": "array", 78 | "items": { 79 | "type": "array", 80 | "items": { 81 | "type": "array", 82 | "items": { 83 | "type": "integer", 84 | "default": 0, 85 | "minimum": 0, 86 | "maximum": 3 87 | } 88 | } 89 | }, 90 | "default": [] 91 | } 92 | }, 93 | "required": [] 94 | }, 95 | "uiSchema": { 96 | "type": "FontEditor", 97 | "scope": "#" 98 | }, 99 | "icon": "codicon codicon-case-sensitive", 100 | "templates": [ 101 | "FontsC", 102 | "FontsH", 103 | "FontSpec" 104 | ] 105 | } -------------------------------------------------------------------------------- /source/Debugging/Tool/Tool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef TOOL_H_ 11 | #define TOOL_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // CLASS'S DECLARATION 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | class ToolState; 25 | 26 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 27 | // CLASS' DECLARATION 28 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 29 | 30 | /// Class Tool 31 | /// 32 | /// Inherits from Object 33 | /// 34 | /// Defines an interface for debugging tools. 35 | abstract class Tool : ListenerObject 36 | { 37 | /// @protectedsection 38 | 39 | ToolState toolState; 40 | 41 | /// @publicsection 42 | 43 | /// Class' constructor 44 | void constructor(); 45 | 46 | /// Set the VUEngine's current game state. 47 | /// @param currentGameState: Game's current game state 48 | void setToolState(ToolState toolState); 49 | 50 | /// Process the provided user pressed key. 51 | /// @param pressedKey: User pressed key 52 | virtual void processUserInput(uint16 pressedKey) = 0; 53 | 54 | /// Dimm down the game. 55 | virtual void dimmGame(); 56 | 57 | /// Light up the game. 58 | virtual void lightUpGame(); 59 | 60 | /// Update the tool's state. 61 | virtual void update() = 0; 62 | 63 | /// Show the tool. 64 | virtual void show() = 0; 65 | 66 | /// Hide the tool. 67 | virtual void hide() = 0; 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /source/Misc/Optics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef OPTICS_H_ 11 | #define OPTICS_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class Optics 24 | /// 25 | /// Inherits from Object 26 | /// 27 | /// Computes parallax. 28 | static class Optics : Object 29 | { 30 | /// @publicsection 31 | 32 | /// Calculate parallax based on the z coordinate. 33 | /// @param z: 3D coordinate 34 | /// @return Parallax value (in pixels) 35 | static inline int16 calculateParallax(fixed_t z); 36 | } 37 | 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | // CLASS' PUBLIC STATIC METHODS 40 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 41 | 42 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 43 | 44 | static inline int16 Optics::calculateParallax(fixed_t z) 45 | { 46 | fixed_t divisor = (_optical->halfWidth << 1) + z; 47 | 48 | if(0 == divisor) 49 | { 50 | return 0; 51 | } 52 | 53 | ASSERT(0 <= _optical->baseDistance, "Optics::calculateParallax: baseDistance < 0"); 54 | 55 | return __METERS_TO_PIXELS(__FIXED_EXT_DIV(__FIXED_EXT_MULT(((unsigned)_optical->baseDistance), z), divisor)); 56 | } 57 | 58 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Sprite/AnimationController/AnimationCoordinatorFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef ANIMATION_COORDINATOR_FACTORY_H_ 11 | #define ANIMATION_COORDINATOR_FACTORY_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // FORWARD DECLARATIONS 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | class AnimationController; 25 | class AnimationCoordinator; 26 | class ListenerObject; 27 | 28 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 29 | // CLASS' DECLARATION 30 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 31 | 32 | /// Class AnimationCoordinator 33 | /// 34 | /// Inherits from ListenerObject 35 | /// 36 | /// Creates instances of animation coordinators. 37 | singleton class AnimationCoordinatorFactory : Object 38 | { 39 | /// @protectedsection 40 | 41 | /// List of instances of animation coordinators 42 | VirtualList animationCoordinators; 43 | 44 | /// @publicsection 45 | 46 | /// Get an animation coordinator. 47 | /// @param animationController: Animation controller to potentially coordinate 48 | /// @param scope: Object that might need to listen for playback related events 49 | /// @param charSetSpec: CharSetSpec shared by the animation controllers to coordinate 50 | /// @return ClockManager singleton 51 | AnimationCoordinator getCoordinator(AnimationController animationController, ListenerObject scope, const CharSetSpec* charSetSpec); 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /source/Hardware/SRAMManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef SRAM_MANAGER_H_ 11 | #define SRAM_MANAGER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // FORWARD DECLARATIONS 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | // Forward declaration of a struct that each game has to define 24 | struct SaveData; 25 | 26 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 27 | // CLASS' DECLARATION 28 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 29 | 30 | /// Class SRAMManager 31 | /// 32 | /// Inherits from Object 33 | /// 34 | /// Manages SRAM space since most carts requiere a proxy to address 35 | /// by not having all the pins routed. 36 | singleton class SRAMManager : Object 37 | { 38 | /// @protectedsection 39 | 40 | /// SRAM start address 41 | uint16* spaceAddress; 42 | 43 | /// Save data to SRAM. 44 | /// @param source WRAM address from were data will be copied 45 | /// @param memberOffset WRAM address offset 46 | /// @param dataSize Number of BYTES to read 47 | static void save(const uint8* const source, int32 memberOffset, int32 dataSize); 48 | 49 | /// Retrieve data from SRAM. 50 | /// @param destination WRAM address were data will be loaded 51 | /// @param memberOffset WRAM address offset 52 | /// @param dataSize Number of BYTES to read 53 | static void read(uint8* destination, int32 memberOffset, int32 dataSize); 54 | 55 | /// Reset the manager's state. 56 | void reset(); 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /source/Misc/Messaging/Telegram.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef TELEGRAM_H_ 11 | #define TELEGRAM_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class Telegram 24 | /// 25 | /// Inherits from Object 26 | /// 27 | /// Wraps a message to be sent to an Object. 28 | class Telegram : Object 29 | { 30 | /// @protectedsection 31 | 32 | /// The message's code 33 | int32 message; 34 | 35 | /// Additional information that may accompany the message 36 | void* extraInfo; 37 | 38 | /// The object that sends the message 39 | void* sender; 40 | 41 | /// The object that receives the message 42 | void* receiver; 43 | 44 | /// @publicsection 45 | 46 | /// Class' constructor 47 | /// @param sender: The object that sends the message 48 | /// @param receiver: The object that sends the message 49 | /// @param message: The message's code 50 | /// @param extraInfo: Additional information that may accompany the message 51 | void constructor(void* sender, void* receiver, int32 message, void* extraInfo); 52 | 53 | /// Retrieve the Telegram's sender. 54 | /// @return Pointer to the object that sent the message 55 | void* getSender(); 56 | 57 | /// Retrieve the Telegram's receiver. 58 | /// @return Pointer to the object that receives the message 59 | void* getReceiver(); 60 | 61 | /// Retrieve the Telegram's message code. 62 | /// @return The message's code 63 | int32 getMessage(); 64 | 65 | /// Retrieve the Telegram's sender. 66 | /// @return Additional information that may accompany the message 67 | void* getExtraInfo(); 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Sprite/ObjectSpriteContainer/ObjectSpriteContainer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef OBJECT_SPRITE_CONTAINER_H_ 11 | #define OBJECT_SPRITE_CONTAINER_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // FORWARD DECLARATIONS 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | class ObjectSprite; 24 | 25 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 26 | // CLASS' DECLARATION 27 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 28 | 29 | /// Class ObjectSpriteContainer 30 | /// 31 | /// Inherits from Sprite 32 | /// 33 | /// Manages ObjectSprites that are displayed in the same SPT. 34 | class ObjectSpriteContainer : Sprite 35 | { 36 | /// @publicsection 37 | 38 | /// Class' constructor 39 | void constructor(); 40 | 41 | /// Retrieve the basic class of this kind of sprite. 42 | /// @return ClassPointer the basic class 43 | override ClassPointer getBasicType(); 44 | 45 | /// Render the sprite by configuring the DRAM assigned to it by means of the provided index. 46 | /// @param index: Determines the region of DRAM that this sprite is allowed to configure 47 | /// @return The index that determines the region of DRAM that this sprite manages 48 | override int16 doRender(int16 index); 49 | 50 | /// Retrieve the total number of pixels actually displayed by all the managed sprites. 51 | /// @return Total number of pixels displayed by all the managed sprites 52 | override int32 getTotalPixels(); 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /contributions/Template/config.make.njk: -------------------------------------------------------------------------------- 1 | {%- if project.items.CompilerConfig.project is defined -%} 2 | {%- set compiler = project.items.CompilerConfig.project -%} 3 | {%- else -%} 4 | {%- set compiler = project.items.CompilerConfig.engine -%} 5 | {%- endif -%} 6 | {%- set plugins = project.items.GameConfig.project.plugins | default({}) -%} 7 | {% include('templates/partials/fileHeader/fileHeader.make.njk') %} 8 | 9 | # VUEngine plugins which the project uses 10 | PLUGINS = {{ plugins | keys | sort | join(' \\\n\t\t\t\t\t\t\t\t ') | safe }} 11 | 12 | # Optimization level 13 | OPTIMIZATION = {{ compiler.optimization }} 14 | 15 | # Frame pointer's usage 16 | # 0: Omit. 17 | # 1: Use. 18 | USE_FRAME_POINTER = {% if compiler.framePointer %}1{% else %}0{% endif %} 19 | 20 | # Prolog functions' usage 21 | # 0: Omit. 22 | # 1: Use. 23 | USE_PROLOG_FUNCTIONS = {% if compiler.prologFunctions %}1{% else %}0{% endif %} 24 | 25 | # Sections' usage 26 | # SRAM's usage 27 | # You can use SRAM as WRAM. It adds, theoretically, 16MB of WRAM where all non initialized variables can be allocated. 28 | # This feature is experimental and only works properly on emulators. 29 | # Since only 8KB of SRAM is available on real carts, more than that will only work on emulators. 30 | # To make effective any change to these options, the whole project needs to be recompiled. 31 | # DRAM can be used as WRAM too, you must edit the linker script vb.ld to accommodate this 32 | # taking into account that the Param Table's last address normally is 0x0003D800, where 33 | # the WORLD attributes start. 34 | 35 | # valid options are [/.data/.sdata/.dram_data/.sram_data] 36 | MEMORY_POOL_SECTION = {{ compiler.memoryUsage.memoryPool }} 37 | # valid options are [/.bss/.sbss/.dram_bss/.sram_bss] 38 | NON_INITIALIZED_GLOBAL_DATA_SECTION = {{ compiler.memoryUsage.uninitializedData }} 39 | # valid options are [/.data/.sdata/.dram_data/.sram_data] 40 | INITIALIZED_GLOBAL_DATA_SECTION = {{ compiler.memoryUsage.initializedData }} 41 | # valid options are [/.bss/.sbss/.dram_bss/.sram_bss] 42 | STATIC_SINGLETONS_DATA_SECTION = {{ compiler.memoryUsage.staticSingletons }} 43 | # valid options are [/.bss/.sbss/.dram_bss/.sram_bss] 44 | VIRTUAL_TABLES_DATA_SECTION = {{ compiler.memoryUsage.virtualTables }} 45 | 46 | # Size of variables to be loaded in the .sdata section 47 | # Not working properly because rosdata is used instead of rodata section 48 | # MSDA_SIZE = 0 49 | -------------------------------------------------------------------------------- /source/Component/Behavior/Behavior.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include "Behavior.h" 15 | 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | // CLASS' PUBLIC METHODS 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | void Behavior::constructor(Entity owner, const BehaviorSpec* behaviorSpec) 23 | { 24 | // Always explicitly call the base's constructor 25 | Base::constructor(owner, (const ComponentSpec*)&behaviorSpec->componentSpec); 26 | 27 | this->enabled = behaviorSpec->enabled; 28 | } 29 | 30 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 31 | 32 | void Behavior::destructor() 33 | { 34 | // Always explicitly call the base's destructor 35 | Base::destructor(); 36 | } 37 | 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | void Behavior::enable() 41 | { 42 | this->enabled = true; 43 | } 44 | 45 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 46 | 47 | void Behavior::disable() 48 | { 49 | this->enabled = false; 50 | } 51 | 52 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 53 | 54 | bool Behavior::isEnabled() 55 | { 56 | return this->enabled; 57 | } 58 | 59 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 60 | -------------------------------------------------------------------------------- /source/Misc/FrameRate/FrameRate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef FRAMERATE_H_ 11 | #define FRAMERATE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DECLARATION 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// Class FrameRate 24 | /// 25 | /// Inherits from ListenerObject 26 | /// 27 | /// Keeps track of the program's frame rate. 28 | singleton class FrameRate : ListenerObject 29 | { 30 | /// @protectedsection 31 | 32 | /// Accumulated frames per second 33 | uint32 totalFPS; 34 | 35 | /// Accumulated uneven frames per second 36 | uint32 totalUnevenFPS; 37 | 38 | /// Accumualted elapssed seconds 39 | uint16 seconds; 40 | 41 | /// Current frames per second 42 | uint16 FPS; 43 | 44 | /// Total number of game frame starts 45 | uint16 gameFrameStarts; 46 | 47 | /// Uneven frames during the current second 48 | uint16 unevenFPS; 49 | 50 | /// The target frames per second 51 | uint8 targetFPS; 52 | 53 | /// @publicsection 54 | 55 | /// Reset the state of the manager. 56 | void reset(); 57 | 58 | /// Set the target frames per second. 59 | /// @param targetFPS: Target frames per second 60 | void setTarget(uint8 targetFPS); 61 | 62 | /// Update the elapsed frames during the current second. 63 | void update(); 64 | 65 | /// The next game frame cycle has started. 66 | /// @param gameCycleEnded: Flag that indicates if the previous game frame was completed before the current second has elapsed 67 | void gameFrameStarted(bool gameCycleEnded); 68 | 69 | /// Print the frames per second statistics. 70 | /// @param x: Screen x coordinate where to print 71 | /// @param y: Screen y coordinate where to print 72 | void print(int32 x, int32 y); 73 | } 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Sprite/BgmapSprite/FrameBlendBgmapSprite/FrameBlendBgmapSprite.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include "FrameBlendBgmapSprite.h" 21 | 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | // CLASS' PUBLIC METHODS 24 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 25 | 26 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 27 | 28 | void FrameBlendBgmapSprite::constructor(Entity owner, const FrameBlendBgmapSpriteSpec* frameBlendBgmapSpriteSpec) 29 | { 30 | // Always explicitly call the base's constructor 31 | Base::constructor(owner, &frameBlendBgmapSpriteSpec->bgmapSpriteSpec); 32 | 33 | this->actualFrame = 0; 34 | 35 | ASSERT(this->texture, "FrameBlendBgmapSprite::constructor: null texture"); 36 | } 37 | 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | void FrameBlendBgmapSprite::destructor() 41 | { 42 | // Always explicitly call the base's destructor 43 | Base::destructor(); 44 | } 45 | 46 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 47 | 48 | int16 FrameBlendBgmapSprite::doRender(int16 index) 49 | { 50 | this->actualFrame = 0 == this->actualFrame ? 1 : 0; 51 | 52 | FrameBlendBgmapSprite::setMultiframe(this, this->actualFrame); 53 | 54 | return Base::doRender(this, index); 55 | } 56 | 57 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 58 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Wireframe/Line/Line.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef LINE_H_ 11 | #define LINE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DATA 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// A Line spec 24 | /// @memberof Line 25 | typedef struct LineSpec 26 | { 27 | // Wireframe spec 28 | WireframeSpec wireframeSpec; 29 | 30 | /// Starting point 31 | Vector3D a; 32 | 33 | /// End point 34 | Vector3D b; 35 | 36 | } LineSpec; 37 | 38 | /// A Line spec that is stored in ROM 39 | /// @memberof Line 40 | typedef const LineSpec LineROMSpec; 41 | 42 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 43 | // CLASS' DECLARATION 44 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 45 | 46 | /// Class Line 47 | /// 48 | /// Inherits from Wireframe 49 | /// 50 | /// Draws a line. 51 | class Line : Wireframe 52 | { 53 | /// @protectedsection 54 | 55 | /// Starting point 56 | PixelVector a; 57 | 58 | /// End point 59 | PixelVector b; 60 | 61 | /// @publicsection 62 | 63 | /// Class' constructor 64 | /// @param owner: Entity to which the wireframe attaches to 65 | /// @param lineSpec: Specification that determines how to configure the wireframe 66 | void constructor(Entity owner, const LineSpec* lineSpec); 67 | 68 | /// Prepare the wireframe for drawing. 69 | /// @param relativePosition: Position relative to the camera's 70 | override void render(Vector3D relativePosition); 71 | 72 | /// Draw the wireframe to the frame buffers. 73 | /// @return True if at least one pixel is drawn; false otherwise 74 | override bool draw(); 75 | } 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /source/Component/Collider/Ball/Ball.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef BALL_H_ 11 | #define BALL_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // CLASS' DECLARATION 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | /// Class Ball 25 | /// 26 | /// Inherits from Collider 27 | /// 28 | /// Defines a collider with the shape of a ball. 29 | class Ball : Collider 30 | { 31 | /// @protectedsection 32 | 33 | /// Mesh used to draw the collider 34 | SphereSpec* sphereSpec; 35 | 36 | /// The radius of the ball 37 | fixed_t radius; 38 | 39 | /// @publicsection 40 | 41 | /// Project the diameter of a circle defined by its centers and radius onto the provided vector. 42 | /// @param center: Center of the circle whose diameter is projected 43 | /// @param radius: Radius of the circle whose diameter is projected 44 | /// @param vector: Vector onto which to project the circle's diameter 45 | /// @param min min: Variable to store the value of the lowest value of the projection 46 | /// @param max max: Variable to store the value of the biggest value of the projection 47 | static void project(Vector3D center, fixed_t radius, Vector3D vector, fixed_t* min, fixed_t* max); 48 | 49 | /// Class' constructor 50 | void constructor(Entity owner, const ColliderSpec* colliderSpec); 51 | 52 | /// Resize the colliders add the provided increment. 53 | /// @param sizeDelta: Delta to add to the collider's size 54 | override void resize(fixed_t sizeDelta); 55 | 56 | /// Configure the wireframe used to show the collider. 57 | override void configureWireframe(); 58 | 59 | /// Print collider's state. 60 | /// @param x: Screen x coordinate where to print 61 | /// @param y: Screen y coordinate where to print 62 | override void print(int32 x, int32 y); 63 | } 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /source/Component/Mutator/Mutator.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include "Mutator.h" 15 | 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | // CLASS' PUBLIC METHODS 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | void Mutator::constructor(Entity owner, const MutatorSpec* mutatorSpec) 23 | { 24 | // Always explicitly call the base's constructor 25 | Base::constructor(owner, (const ComponentSpec*)&mutatorSpec->componentSpec); 26 | 27 | this->enabled = mutatorSpec->enabled; 28 | 29 | if(NULL != mutatorSpec->targetClass) 30 | { 31 | Entity::mutateTo(owner, mutatorSpec->targetClass); 32 | } 33 | } 34 | 35 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 36 | 37 | void Mutator::destructor() 38 | { 39 | // Always explicitly call the base's destructor 40 | Base::destructor(); 41 | } 42 | 43 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 44 | 45 | void Mutator::enable() 46 | { 47 | this->enabled = true; 48 | } 49 | 50 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 51 | 52 | void Mutator::disable() 53 | { 54 | this->enabled = false; 55 | } 56 | 57 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 58 | 59 | bool Mutator::isEnabled() 60 | { 61 | return this->enabled; 62 | } 63 | 64 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 65 | -------------------------------------------------------------------------------- /lib/compiler/make/makefile: -------------------------------------------------------------------------------- 1 | # Fully qualified plugin name 2 | # (this is set from outside) 3 | NAME = context//plugin-name 4 | 5 | # Engine name 6 | override ENGINE_NAME = core 7 | 8 | # Engine's home 9 | override ENGINE_HOME = $(ENGINE_FOLDER) 10 | 11 | # Home of custom user plugins 12 | USER_PLUGINS_FOLDER = $(PLUGINS_FOLDER) 13 | 14 | # Clean plugin name by stripping out everything up to (and including) the last slash 15 | CLEAN_NAME = $(shell echo $(NAME) | sed -e "s@.*//@@") 16 | 17 | # My home 18 | ifeq ($(NAME), $(ENGINE_NAME)) 19 | override MY_HOME = $(ENGINE_HOME) 20 | else 21 | ifneq (,$(findstring user,$(NAME))) 22 | override MY_HOME = $(USER_PLUGINS_FOLDER)/$(CLEAN_NAME) 23 | else 24 | override MY_HOME = $(PLUGINS_FOLDER)/$(CLEAN_NAME) 25 | endif 26 | endif 27 | 28 | # Where the game lives 29 | GAME_HOME = . 30 | 31 | # Common 32 | include $(ENGINE_HOME)/lib/compiler/make/makefile-common 33 | 34 | # the target file 35 | TARGET_FILE = lib$(BASENAME) 36 | TARGET = $(WORKING_FOLDER)/libraries/$(BUILD_MODE)/$(TARGET_FILE)-$(TYPE) 37 | 38 | # Main target. The @ in front of a command prevents make from displaying it to the standard output. 39 | all: printPreBuildingInfo preprocessClasses plugins printBuildingInfo $(TARGET).a 40 | 41 | printPreBuildingInfo: 42 | 43 | printBuildingInfo: 44 | @echo "" 45 | @$(shell echo $(NAME) >> $(WORKING_FOLDER)/traces/$(BUILD_MODE)/builtComponents.txt) 46 | # @$(eval BUILT_COMPONENTS=$(shell wc -l < $(WORKING_FOLDER)/traces/$(BUILD_MODE)/builtComponents.txt)) 47 | @echo "Building $(BASENAME)" 48 | # @echo "($(BUILT_COMPONENTS)/$(COMPONENTS)) Building $(BASENAME)" 49 | # @$(eval START_TIME=$(shell date +%s)) 50 | 51 | printPostBuildingInfo: 52 | @$(eval END_TIME=$(shell date +%s)) 53 | @echo "Total time:" $$(( ($(END_TIME) - $(START_TIME)) / 60 ))" min. "$$(( ($(END_TIME) - $(START_TIME)) % 60 ))" sec." 54 | 55 | $(TARGET).a: $(H_FILES) $(ASSEMBLY_OBJECTS) $(C_OBJECTS) $(SETUP_CLASSES_OBJECT).o 56 | @echo 57 | @echo "Linking $(TARGET_FILE)-$(TYPE)" 58 | @$(eval SOURCES_OBJECT_FILES=$(shell ls $(WORKING_FOLDER)/objects/$(BUILD_MODE)/hashes/$(NAME)/*.o 2>/dev/null)) 59 | @$(eval ASSETS_OBJECT_FILES=$(shell ls $(WORKING_FOLDER)/assets/$(NAME)/hashes/*.o 2>/dev/null)) 60 | @$(AR) rcsT $@ $(SOURCES_OBJECT_FILES) $(ASSETS_OBJECT_FILES) $(BINARY_ASSETS) $(foreach PLUGIN, $(PLUGINS), $(WORKING_FOLDER)/libraries/$(BUILD_MODE)/lib$(shell echo $(PLUGIN)-$(TYPE) | sed -e "s@.*/@@").a) 61 | 62 | $(BUILD_DIR)/$(TARGET_FILE).a: plugins printBuildingInfo compile $(TARGET).a 63 | @cp $(TARGET).a $(BUILD_DIR)/$(TARGET_FILE).a 64 | -------------------------------------------------------------------------------- /source/Debugging/Tool/StageEditor/StageEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef STAGE_EDITOR_H_ 11 | #define STAGE_EDITOR_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // CLASS' DATA 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | /// A struct to map an actor spec to a name 25 | /// @memberof StageEditor 26 | typedef struct UserObject 27 | { 28 | /// Specification for an actor 29 | ActorSpec* actorSpec; 30 | 31 | /// Actor spec's name 32 | char* name; 33 | 34 | } UserObject; 35 | 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | // CLASS' DECLARATION 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | /// Class SoundTest 41 | /// 42 | /// Inherits from Tool 43 | /// 44 | /// Implements a tool that permits to manipulate a stage's actors. 45 | singleton class StageEditor : Tool 46 | { 47 | /// Node of the stage's selected actor 48 | VirtualNode actorNode; 49 | 50 | /// Current actor's wireframe 51 | Wireframe wireframe; 52 | 53 | /// Sprite to display new actors to be added to the stage 54 | Sprite userActorSprite; 55 | 56 | // Selector of user defined actors 57 | OptionsSelector userActorSelector; 58 | 59 | /// Editor's state 60 | int32 state; 61 | 62 | // Translation step size 63 | int32 translationStepSize; 64 | 65 | /// @publicsection 66 | 67 | /// Update the tool's state. 68 | override void update(); 69 | 70 | /// Show the tool. 71 | override void show(); 72 | 73 | /// Hide the tool. 74 | override void hide(); 75 | 76 | /// Process the provided user pressed key. 77 | /// @param pressedKey: User pressed key 78 | override void processUserInput(uint16 pressedKey); 79 | } 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /source/State/GameState/ToolState/DebugState/DebugState.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifdef __TOOLS 11 | 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | // INCLUDES 14 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 15 | 16 | #include 17 | #include 18 | 19 | #include "DebugState.h" 20 | 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | // CLASS' PUBLIC METHODS 23 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 24 | 25 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 26 | 27 | bool DebugState::isKeyCombination(const UserInput* userInput) 28 | { 29 | return ((userInput->holdKey & K_SEL) && (userInput->holdKey & K_RT) && (userInput->releasedKey & K_RU)); 30 | } 31 | 32 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 33 | 34 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 35 | // CLASS' PRIVATE METHODS 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | void DebugState::constructor() 41 | { 42 | // Always explicitly call the base's constructor 43 | Base::constructor(); 44 | 45 | this->tool = Tool::safeCast(Debug::getInstance()); 46 | } 47 | 48 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 49 | 50 | void DebugState::destructor() 51 | { 52 | // Always explicitly call the base's destructor 53 | Base::destructor(); 54 | } 55 | 56 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /source/Component/Behavior/Behavior.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef BEHAVIOR_H_ 11 | #define BEHAVIOR_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DATA 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// A Behavior Spec 24 | /// @memberof Behavior 25 | typedef struct BehaviorSpec 26 | { 27 | /// Component spec 28 | ComponentSpec componentSpec; 29 | 30 | /// Enabled? 31 | bool enabled; 32 | 33 | } BehaviorSpec; 34 | 35 | /// A Behavior spec that is stored in ROM 36 | /// @memberof Behavior 37 | typedef const BehaviorSpec BehaviorROMSpec; 38 | 39 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 40 | // CLASS' DECLARATION 41 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 42 | 43 | /// Class Behavior 44 | /// 45 | /// Inherits from Component 46 | /// 47 | /// Right now, this is only used by the Vehicle class in the plugins. 48 | /// Eventually, this will serve to avoid the need to inherit from Actor. 49 | class Behavior : Component 50 | { 51 | /// @protectedsection 52 | 53 | /// Flag to allow or prohibit the behavior to perform its operations 54 | bool enabled; 55 | 56 | /// @publicsection 57 | 58 | /// Class' constructor 59 | /// @param owner: Entity to which the behavior attaches to 60 | /// @param behaviorSpec: Specification that determines how to configure the behavior 61 | void constructor(Entity owner, const BehaviorSpec* behaviorSpec); 62 | 63 | /// Enable the behavior's operations. 64 | void enable(); 65 | 66 | /// Disable the behavior's operations. 67 | void disable(); 68 | 69 | /// Check if the behavior's operations are enabled. 70 | /// @return True if the behavior's operations are enabled; false otherwise 71 | bool isEnabled(); 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /source/Misc/Messaging/Events.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef EVENTS_H_ 11 | #define EVENTS_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // DATA 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | enum Events 18 | { 19 | // Do not remove me 20 | kEventEngineFirst = 0, 21 | 22 | // Add events here 23 | kEventFramerateReady, 24 | kEventFramerateDipped, 25 | 26 | kEventContainerAllChildrenDeleted, 27 | kEventStageChildStreamedOut, 28 | kEventColliderDeleted, 29 | kEventColliderChanged, 30 | kEventComponentDestroyed, 31 | 32 | kEventGamePaused, 33 | kEventGameUnpaused, 34 | 35 | kEventNextStateSet, 36 | 37 | kEventSecondChanged, 38 | kEventMinuteChanged, 39 | 40 | kEventAnimationStarted, 41 | kEventAnimationCompleted, 42 | kEventTextureRewritten, 43 | kEventTextureSetFrame, 44 | kEventCharSetChangedFrame, 45 | kEventCharSetChangedOffset, 46 | kEventCharSetDeleted, 47 | kEventFontRewritten, 48 | 49 | kEventEffectFadeInComplete, 50 | kEventEffectFadeOutComplete, 51 | kEventEffectFadeStart, 52 | kEventEffectFadeStop, 53 | 54 | kEventCommunicationsConnected, 55 | kEventCommunicationsTransmissionCompleted, 56 | 57 | kEventActorDeleted, 58 | kEventActorCreated, 59 | kEventActorBounced, 60 | kEventActorCannotMove, 61 | 62 | kEventPlaySounds, 63 | 64 | kEventSoundFinished, 65 | kEventSoundReleased, 66 | 67 | kEventVIPManagerTimeError, 68 | kEventVIPManagerScanError, 69 | kEventVIPManagerFRAMESTART, 70 | kEventVIPManagerGAMESTART, 71 | kEventVIPManagerGAMESTARTDuringGAMESTART, 72 | kEventVIPManagerGAMESTARTDuringXPEND, 73 | kEventVIPManagerXPEND, 74 | kEventVIPManagerXPENDDuringXPEND, 75 | kEventVIPManagerXPENDDuringGAMESTART, 76 | 77 | kEventTimerManagerInterrupt, 78 | 79 | kEventKeypadManagerRaisedPowerFlag, 80 | 81 | kEventStateMachineWillCleanStack, 82 | kEventStateMachineCleanedStack, 83 | kEventStateMachineWillSwapState, 84 | kEventStateMachineSwapedState, 85 | kEventStateMachineWillPushState, 86 | kEventStateMachinePushedState, 87 | kEventStateMachineWillPopState, 88 | kEventStateMachinePoppedState, 89 | 90 | kEventVUEngineNextSecondStarted, 91 | 92 | // Do not remove me 93 | kEventPluginsFirst = 1000, 94 | kEventGameFirst = 10000, 95 | kEventEngineLast 96 | }; 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /source/State/GameState/ToolState/StageEditorState/StageEditorState.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifdef __TOOLS 11 | 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | // INCLUDES 14 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 15 | 16 | #include 17 | #include 18 | 19 | #include "StageEditorState.h" 20 | 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | // CLASS' PUBLIC METHODS 23 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 24 | 25 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 26 | 27 | bool StageEditorState::isKeyCombination(const UserInput* userInput) 28 | { 29 | return ((userInput->holdKey & K_SEL) && (userInput->holdKey & K_RT) && (userInput->releasedKey & K_RL)); 30 | } 31 | 32 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 33 | 34 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 35 | // CLASS' PRIVATE METHODS 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | void StageEditorState::constructor() 41 | { 42 | // Always explicitly call the base's constructor 43 | Base::constructor(); 44 | 45 | this->tool = Tool::safeCast(StageEditor::getInstance()); 46 | } 47 | 48 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 49 | 50 | void StageEditorState::destructor() 51 | { 52 | // Always explicitly call the base's destructor 53 | Base::destructor(); 54 | } 55 | 56 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /source/State/State.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef STATE_H_ 11 | #define STATE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // FORWARD DECLARATIONS 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | class Telegram; 24 | 25 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 26 | // CLASS' DECLARATION 27 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 28 | 29 | /// Class State 30 | /// 31 | /// Inherits from ListenerObject 32 | /// 33 | /// Implements a behavioral model to be used in a finite state machine. 34 | abstract class State : ListenerObject 35 | { 36 | /// @publicsection 37 | 38 | /// Class's constructor 39 | void constructor(); 40 | 41 | /// Class's destructor 42 | void destructor(); 43 | 44 | /// Prepares the object to enter this state. 45 | /// @param owner: Object that is entering in this state 46 | virtual void start(void* owner); 47 | 48 | /// Updates the object in this state. 49 | /// @param owner: Object that is in this state 50 | virtual void update(void* owner); 51 | 52 | /// Prepares the object to exit this state. 53 | /// @param owner: Object that is exiting this state 54 | virtual void stop(void* owner); 55 | 56 | /// Prepares the object to become inactive in this state. 57 | /// @param owner: Object that is in this state 58 | virtual void pause(void* owner); 59 | 60 | /// Prepares the object to become active in this state. 61 | /// @param owner: Object that is in this state 62 | virtual void unpause(void* owner); 63 | 64 | /// Process a Telegram sent to an object that is in this state. 65 | /// @param owner: Object that is in this state 66 | /// @param telegram: Telegram to process 67 | virtual bool processMessage(void* owner, Telegram telegram); 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /source/Component/Mutator/Mutator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef MUTATOR_H_ 11 | #define MUTATOR_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DATA 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// A Mutator Spec 24 | /// @memberof Mutator 25 | typedef struct MutatorSpec 26 | { 27 | /// Component spec 28 | ComponentSpec componentSpec; 29 | 30 | /// Mutation target class 31 | void* (*targetClass)(); 32 | 33 | /// Enabled? 34 | bool enabled; 35 | 36 | } MutatorSpec; 37 | 38 | /// A Mutator spec that is stored in ROM 39 | /// @memberof Mutator 40 | typedef const MutatorSpec MutatorROMSpec; 41 | 42 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 43 | // CLASS' DECLARATION 44 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 45 | 46 | /// Class Mutator 47 | /// 48 | /// Inherits from Component 49 | /// 50 | /// Right now, this is only used by the Vehicle class in the plugins. 51 | /// Eventually, this will serve to avoid the need to inherit from Actor. 52 | class Mutator : Component 53 | { 54 | /// @protectedsection 55 | 56 | /// Flag to allow or prohibit the mutator to perform its operations 57 | bool enabled; 58 | 59 | /// @publicsection 60 | 61 | /// Class' constructor 62 | /// @param owner: Entity to which the mutator attaches to 63 | /// @param mutatorSpec: Specification that determines how to configure the mutator 64 | void constructor(Entity owner, const MutatorSpec* mutatorSpec); 65 | 66 | /// Enable the mutator's operations. 67 | void enable(); 68 | 69 | /// Disable the mutator's operations. 70 | void disable(); 71 | 72 | /// Check if the mutator's operations are enabled. 73 | /// @return True if the mutator's operations are enabled; false otherwise 74 | bool isEnabled(); 75 | } 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Wireframe/Asterisk/Asterisk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef ASTERISK_H_ 11 | #define ASTERISK_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DATA 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// A Asterisk spec 24 | /// @memberof Asterisk 25 | typedef struct AsteriskSpec 26 | { 27 | // Wireframe spec 28 | WireframeSpec wireframeSpec; 29 | 30 | // Length of the segments 31 | fixed_t length; 32 | 33 | } AsteriskSpec; 34 | 35 | /// A Asterisk spec that is stored in ROM 36 | /// @memberof Asterisk 37 | typedef const AsteriskSpec AsteriskROMSpec; 38 | 39 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 40 | // CLASS' DECLARATION 41 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 42 | 43 | /// Class Asterisk 44 | /// 45 | /// Inherits from Wireframe 46 | /// 47 | /// Draws an asterisk. 48 | class Asterisk : Wireframe 49 | { 50 | /// @protectedsection 51 | 52 | /// Position at which to draw the wireframe 53 | PixelVector position; 54 | 55 | /// Length of the asterisk's lines 56 | fixed_t length; 57 | 58 | /// Used length of the asterisk's lines to draw them 59 | uint16 scaledLength; 60 | 61 | /// @publicsection 62 | 63 | /// Class' constructor 64 | /// @param owner: Entity to which the wireframe attaches to 65 | /// @param asteriskSpec: Specification that determines how to configure the wireframe 66 | void constructor(Entity owner, const AsteriskSpec* asteriskSpec); 67 | 68 | /// Prepare the wireframe for drawing. 69 | /// @param relativePosition: Position relative to the camera's 70 | override void render(Vector3D relativePosition); 71 | 72 | /// Draw the wireframe to the frame buffers. 73 | /// @return True if at least one pixel is drawn; false otherwise 74 | override bool draw(); 75 | } 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /source/State/GameState/ToolState/AnimationInspectorState/AnimationInspectorState.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifdef __TOOLS 11 | 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | // INCLUDES 14 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 15 | 16 | #include 17 | #include 18 | 19 | #include "AnimationInspectorState.h" 20 | 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | // CLASS' PUBLIC METHODS 23 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 24 | 25 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 26 | 27 | bool AnimationInspectorState::isKeyCombination(const UserInput* userInput) 28 | { 29 | return ((userInput->holdKey & K_SEL) && (userInput->holdKey & K_RT) && (userInput->releasedKey & K_RR)); 30 | } 31 | 32 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 33 | 34 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 35 | // CLASS' PRIVATE METHODS 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | void AnimationInspectorState::constructor() 41 | { 42 | // Always explicitly call the base's constructor 43 | Base::constructor(); 44 | 45 | this->tool = Tool::safeCast(AnimationInspector::getInstance()); 46 | } 47 | 48 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 49 | 50 | void AnimationInspectorState::destructor() 51 | { 52 | // Always explicitly call the base's destructor 53 | Base::destructor(); 54 | } 55 | 56 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /source/Debugging/Tool/Debug/Debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef DEBUG_H_ 11 | #define DEBUG_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DATA 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// A struct to map a class size function to a name 24 | /// @memberof Debug 25 | typedef struct ClassSizeData 26 | { 27 | /// Class' method 28 | int32 (*classSizeFunction)(void); 29 | 30 | /// Class' name 31 | char* name; 32 | 33 | } ClassSizeData; 34 | 35 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 36 | // CLASS' DECLARATION 37 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 38 | 39 | /// Class Debug 40 | /// 41 | /// Inherits from Tool 42 | /// 43 | /// Implements a tool that displays various debug information. 44 | singleton class Debug : Tool 45 | { 46 | /// Degug pages 47 | VirtualList pages; 48 | 49 | /// Debug sub pages 50 | VirtualList subPages; 51 | 52 | /// Current page's node 53 | VirtualNode currentPage; 54 | 55 | /// Current sub page's node 56 | VirtualNode currentSubPage; 57 | 58 | /// Current sprite's index 59 | int8 spriteIndex; 60 | 61 | /// Currently displayed BGMAP segment 62 | int8 bgmapSegment; 63 | 64 | /// Currently displayed part of BGMAP memory 65 | uint8 bgmapSegmentDiplayedSection; 66 | 67 | /// Currently displayed OBJECT segment 68 | int32 objectSegment; 69 | 70 | /// Currently displayed CHAR memory segment 71 | int32 charSegment; 72 | 73 | /// Currently displayed SRAM page 74 | int32 sramPage; 75 | 76 | /// @publicsection 77 | 78 | /// Update the tool's state. 79 | override void update(); 80 | 81 | /// Show the tool. 82 | override void show(); 83 | 84 | /// Hide the tool. 85 | override void hide(); 86 | 87 | /// Process the provided user pressed key. 88 | /// @param pressedKey: User pressed key 89 | override void processUserInput(uint16 pressedKey); 90 | } 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Sprite/BgmapSprite/FrameBlendBgmapSprite/FrameBlendBgmapSprite.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef FRAME_BLEND_BGMAP_SPRITE_H_ 11 | #define FRAME_BLEND_BGMAP_SPRITE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' DATA 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | /// A FrameBlendBgmapSprite spec 24 | /// @memberof FrameBlendBgmapSprite 25 | typedef struct FrameBlendBgmapSpriteSpec 26 | { 27 | /// it has a Sprite spec at the beginning 28 | BgmapSpriteSpec bgmapSpriteSpec; 29 | 30 | } FrameBlendBgmapSpriteSpec; 31 | 32 | /// A FrameBlendBgmapSprite spec that is stored in ROM. 33 | /// @memberof FrameBlendBgmapSprite 34 | typedef const FrameBlendBgmapSpriteSpec FrameBlendBgmapSpriteROMSpec; 35 | 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | // CLASS' DECLARATION 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | /// Class FrameBlendBgmapSprite 41 | /// 42 | /// Inherits from BgmapSprite 43 | /// 44 | /// Blends two frames of animation into a single one to achieve hi color images with a single sprite. 45 | class FrameBlendBgmapSprite : BgmapSprite 46 | { 47 | /// The frame to show during the game cycle 48 | uint8 actualFrame; 49 | 50 | /// @publicsection 51 | 52 | /// Class' constructor 53 | /// @param owner: Entity to which the sprite attaches to 54 | /// @param frameBlendBgmapSpriteSpec: Specification that determines how to configure the sprite 55 | void constructor(Entity owner, const FrameBlendBgmapSpriteSpec* frameBlendBgmapSpriteSpec); 56 | 57 | /// Render the sprite by configuring the DRAM assigned to it by means of the provided index. 58 | /// @param index: Determines the region of DRAM that this sprite is allowed to configure 59 | /// @return The index that determines the region of DRAM that this sprite manages 60 | override int16 doRender(int16 index); 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Sprite/Texture/ObjectTexture/ObjectTexture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef OBJECT_TEXTURE_H_ 11 | #define OBJECT_TEXTURE_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // FORWARD DECLARATIONS 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | class ObjectSprite; 24 | 25 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 26 | // CLASS' MACROS 27 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 28 | 29 | // Start address of OBJECT space 30 | #define __OBJECT_SPACE_BASE_ADDRESS 0x0003E000 31 | 32 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 33 | // CLASS' DATA 34 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 35 | 36 | /// A ObjectTexture spec 37 | /// @memberof ObjectTexture 38 | typedef const TextureSpec ObjectTextureSpec; 39 | 40 | /// A ObjectTexture spec that is stored in ROM 41 | /// @memberof ObjectTexture 42 | typedef const ObjectTextureSpec ObjectTextureROMSpec; 43 | 44 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 45 | // CLASS' DECLARATION 46 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 47 | 48 | /// Class BgmapTexture 49 | /// 50 | /// Inherits from Texture 51 | /// 52 | /// A texture allocated in OBJECT memory. 53 | class ObjectTexture : Texture 54 | { 55 | /// @publicsection 56 | 57 | /// Class' constructor 58 | /// @param objectTextureSpec: Specification that determines how to configure the texture 59 | /// @param id: Texture's identificator 60 | void constructor(const ObjectTextureSpec* objectTextureSpec, uint16 id); 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /source/Misc/Lists/VirtualNode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include "VirtualNode.h" 15 | 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | // CLASS' PUBLIC METHODS 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | void VirtualNode::constructor(const void* const data) 23 | { 24 | // Always explicitly call the base's constructor 25 | Base::constructor(); 26 | 27 | // Initialize members 28 | this->next = NULL; 29 | this->previous = NULL; 30 | this->data = (void*)data; 31 | } 32 | 33 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 34 | 35 | void VirtualNode::destructor() 36 | { 37 | // Always explicitly call the base's destructor 38 | Base::destructor(); 39 | } 40 | 41 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 42 | 43 | void* VirtualNode::getData() 44 | { 45 | return this->data; 46 | } 47 | 48 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 49 | 50 | VirtualNode VirtualNode::getNext() 51 | { 52 | return this->next; 53 | } 54 | 55 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 56 | 57 | VirtualNode VirtualNode::getPrevious() 58 | { 59 | return this->previous; 60 | } 61 | 62 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 63 | 64 | void VirtualNode::swapData(VirtualNode node) 65 | { 66 | if(isDeleted(node)) 67 | { 68 | return; 69 | } 70 | 71 | void* auxData = this->data; 72 | this->data = node->data; 73 | node->data = auxData; 74 | } 75 | 76 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 77 | -------------------------------------------------------------------------------- /source/Misc/Messaging/Telegram.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include "Telegram.h" 15 | 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | // CLASS' PUBLIC METHODS 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | void Telegram::constructor(void* sender, void* receiver, int32 message, void* extraInfo) 23 | { 24 | // Always explicitly call the base's constructor 25 | Base::constructor(); 26 | 27 | // Set the attributes 28 | this->sender = sender; 29 | this->receiver = receiver; 30 | this->message = message; 31 | this->extraInfo = extraInfo; 32 | } 33 | 34 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 35 | 36 | void Telegram::destructor() 37 | { 38 | this->sender = NULL; 39 | 40 | this->receiver = NULL; 41 | 42 | // Free the memory 43 | 44 | // Always explicitly call the base's destructor 45 | Base::destructor(); 46 | } 47 | 48 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 49 | 50 | void* Telegram::getSender() 51 | { 52 | return this->sender; 53 | } 54 | 55 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 56 | 57 | void* Telegram::getReceiver() 58 | { 59 | return this->receiver; 60 | } 61 | 62 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 63 | 64 | int32 Telegram::getMessage() 65 | { 66 | return this->message; 67 | } 68 | 69 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 70 | 71 | void* Telegram::getExtraInfo() 72 | { 73 | return this->extraInfo; 74 | } 75 | 76 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 77 | -------------------------------------------------------------------------------- /source/Misc/Memory/Mem.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | 16 | #include 17 | 18 | #include "Mem.h" 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // CLASS' PUBLIC STATIC METHODS 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 25 | 26 | /// It doesn't need to be inlined since it is not used in performance critical places 27 | /// and it produces graphical glitches when inlined. 28 | static void Mem::clear(uint8* destination, uint32 numberOfBYTES) 29 | { 30 | uint32 i; 31 | 32 | for(i = 0; i < numberOfBYTES; i++) 33 | { 34 | *destination++ = 0; 35 | } 36 | } 37 | 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 41 | // GLOBAL METHODS REDEFINITIONS 42 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 43 | 44 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 45 | 46 | /// Redefinition of memcpy 47 | __attribute__ ((unused)) static void* memcpy(void *destination, const void *source, size_t numberOfBytes) 48 | { 49 | uint8* finalSource = (uint8*)source + numberOfBytes / sizeof(uint32) + __MODULO(numberOfBytes, sizeof(uint32)); 50 | 51 | asm 52 | ( 53 | "jr end%= \n\t" \ 54 | "loop%=: \n\t" \ 55 | "ld.w 0[%1], r10 \n\t" \ 56 | "st.w r10, 0[%0] \n\t" \ 57 | "add 4, %0 \n\t" \ 58 | "add 4, %1 \n\t" \ 59 | "end%=: \n\t" \ 60 | "cmp %1, %2 \n\t" \ 61 | "bgt loop%= \n\t" 62 | : // No Output 63 | : "r" (destination), "r" (source), "r" (finalSource) 64 | : "r10" // regs used 65 | ); 66 | 67 | return destination; 68 | } 69 | 70 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 71 | -------------------------------------------------------------------------------- /assets/ColumnTable/Converted/DefaultColumnTableSpec.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /////////////////////////////////////////////// THIS FILE WAS AUTO-GENERATED - DO NOT EDIT /////////////////////////////////////////////// 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 6 | // INCLUDES 7 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 8 | 9 | #include 10 | 11 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 12 | // DEFINITIONS 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | 15 | ColumnTableROMSpec DefaultColumnTableSpec = 16 | { 17 | // Mirror spec? 18 | false, 19 | 20 | // Column table spec 21 | { 22 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 23 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 24 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 25 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 26 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 27 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 28 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 29 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xE0, 0xBC, 30 | 0xA6, 0x96, 0x8A, 0x82, 0x7A, 0x74, 0x6E, 0x6A, 31 | 0x66, 0x62, 0x60, 0x5C, 0x5A, 0x58, 0x56, 0x54, 32 | 0x52, 0x50, 0x50, 0x4E, 0x4C, 0x4C, 0x4A, 0x4A, 33 | 0x48, 0x48, 0x46, 0x46, 0x46, 0x44, 0x44, 0x44, 34 | 0x42, 0x42, 0x42, 0x40, 0x40, 0x40, 0x40, 0x40, 35 | 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3C, 36 | 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 37 | 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 38 | 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 39 | 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 40 | 0x3C, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 41 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x42, 0x42, 0x42, 42 | 0x44, 0x44, 0x44, 0x46, 0x46, 0x46, 0x48, 0x48, 43 | 0x4A, 0x4A, 0x4C, 0x4C, 0x4E, 0x50, 0x50, 0x52, 44 | 0x54, 0x56, 0x58, 0x5A, 0x5C, 0x60, 0x62, 0x66, 45 | 0x6A, 0x6E, 0x74, 0x7A, 0x82, 0x8A, 0x96, 0xA6, 46 | 0xBC, 0xE0, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 47 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 48 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 49 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 50 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 51 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 52 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 53 | 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 54 | } 55 | }; -------------------------------------------------------------------------------- /source/Debugging/Tool/AnimationInspector/AnimationInspector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifndef ANIMATION_INSPECTOR_H_ 11 | #define ANIMATION_INSPECTOR_H_ 12 | 13 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 14 | // INCLUDES 15 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 16 | 17 | #include 18 | #include 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | // CLASS' DATA 22 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 23 | 24 | /// A struct to map an animated actor spec to a name 25 | /// @memberof AnimationInspector 26 | typedef struct UserActor 27 | { 28 | /// Specification for an animated actor 29 | const ActorSpec* actorSpec; 30 | 31 | /// Animated actor spec's name 32 | const char* name; 33 | 34 | } UserActor; 35 | 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | // CLASS' DECLARATION 38 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 39 | 40 | /// Class AnimationInspector 41 | /// 42 | /// Inherits from Tool 43 | /// 44 | /// Implements a tool that manipulates animations. 45 | singleton class AnimationInspector : Tool 46 | { 47 | /// Currently inspected sprite 48 | Sprite sprite; 49 | 50 | /// Animations to apply to the animated sprite 51 | const AnimationFunction** animationFunctions; 52 | 53 | /// Currently applied animation 54 | AnimationFunction animationFunction; 55 | 56 | /// Selector for the animated actors 57 | OptionsSelector actorSelector; 58 | 59 | /// Selector for the animated sprite sprite selector 60 | OptionsSelector spriteSelector; 61 | 62 | /// Selector for the animations to play 63 | OptionsSelector animationsSelector; 64 | 65 | /// Selector for the animation's properties 66 | OptionsSelector animationEditionSelector; 67 | 68 | /// Selector for the animation's frames 69 | OptionsSelector frameEditionSelector; 70 | 71 | /// Inspector's state 72 | int32 state; 73 | 74 | /// @publicsection 75 | 76 | /// Update the tool's state. 77 | override void update(); 78 | 79 | /// Show the tool. 80 | override void show(); 81 | 82 | /// Hide the tool. 83 | override void hide(); 84 | 85 | /// Process the provided user pressed key. 86 | /// @param pressedKey: User pressed key 87 | override void processUserInput(uint16 pressedKey); 88 | } 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /source/State/State.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include "State.h" 15 | 16 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 17 | // CLASS' PUBLIC METHODS 18 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 19 | 20 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 21 | 22 | void State::constructor() 23 | { 24 | // Always explicitly call the base's constructor 25 | Base::constructor(); 26 | } 27 | 28 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 29 | 30 | void State::destructor() 31 | { 32 | // Always explicitly call the base's destructor 33 | Base::destructor(); 34 | } 35 | 36 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 37 | 38 | void State::start(void* owner __attribute__ ((unused))) 39 | {} 40 | 41 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 42 | 43 | void State::update(void* owner __attribute__ ((unused))) 44 | {} 45 | 46 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 47 | 48 | void State::stop(void* owner __attribute__ ((unused))) 49 | {} 50 | 51 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 52 | 53 | void State::pause(void* owner __attribute__ ((unused))) 54 | {} 55 | 56 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 57 | 58 | void State::unpause(void* owner __attribute__ ((unused))) 59 | {} 60 | 61 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 62 | 63 | bool State::processMessage(void* owner __attribute__ ((unused)), Telegram telegram __attribute__ ((unused))) 64 | { 65 | return false; 66 | } 67 | 68 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 69 | -------------------------------------------------------------------------------- /source/Component/VisualComponent/Wireframe/Line/Line.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 11 | // INCLUDES 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | 14 | #include 15 | #include 16 | 17 | #include "Line.h" 18 | 19 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 20 | // CLASS' PUBLIC METHODS 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | 23 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 24 | 25 | void Line::constructor(Entity owner, const LineSpec* lineSpec) 26 | { 27 | // Always explicitly call the base's constructor 28 | Base::constructor(owner, &lineSpec->wireframeSpec); 29 | 30 | this->a = PixelVector::zero(); 31 | this->b = PixelVector::zero(); 32 | } 33 | 34 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 35 | 36 | void Line::destructor() 37 | { 38 | // Always explicitly call the base's destructor 39 | Base::destructor(); 40 | } 41 | 42 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 43 | 44 | void Line::render(Vector3D relativePosition) 45 | { 46 | if(NULL == this->componentSpec) 47 | { 48 | return; 49 | } 50 | 51 | Vector3D a = Vector3D::sum(relativePosition, ((LineSpec*)this->componentSpec)->a); 52 | a = Vector3D::rotate(a, *_cameraInvertedRotation); 53 | this->a = PixelVector::projectVector3D(a, Optics::calculateParallax(a.z)); 54 | 55 | Vector3D b = Vector3D::sum(relativePosition, ((LineSpec*)this->componentSpec)->b); 56 | b = Vector3D::rotate(b, *_cameraInvertedRotation); 57 | this->b = PixelVector::projectVector3D(b, Optics::calculateParallax(b.z)); 58 | } 59 | 60 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 61 | 62 | bool Line::draw() 63 | { 64 | bool drawn = FrameBufferManager::drawLine 65 | ( 66 | this->a, 67 | this->b, 68 | this->color, 69 | this->bufferIndex, 70 | this->interlaced 71 | ); 72 | 73 | this->bufferIndex = !this->bufferIndex; 74 | 75 | return drawn; 76 | } 77 | 78 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 79 | -------------------------------------------------------------------------------- /source/State/GameState/ToolState/SoundTestState/SoundTestState.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VUEngine Core 3 | * 4 | * © Jorge Eremiev and Christian Radke 5 | * 6 | * For the full copyright and license information, please view the LICENSE file 7 | * that was distributed with this source code. 8 | */ 9 | 10 | #ifdef __TOOLS 11 | 12 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 13 | // INCLUDES 14 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 15 | 16 | #include 17 | #include 18 | 19 | #include "SoundTestState.h" 20 | 21 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 22 | // CLASS' PUBLIC METHODS 23 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 24 | 25 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 26 | 27 | void SoundTestState::enter(void* owner __attribute__ ((unused))) 28 | { 29 | Base::enter(this, owner); 30 | 31 | this->stream = false; 32 | this->transform = false; 33 | this->updatePhysics = false; 34 | this->processCollisions = false; 35 | } 36 | 37 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 38 | 39 | bool SoundTestState::isKeyCombination(const UserInput* userInput) 40 | { 41 | return ((userInput->holdKey & K_SEL) && (userInput->holdKey & K_RT) && (userInput->releasedKey & K_RD)); 42 | } 43 | 44 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 45 | 46 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 47 | // CLASS' PRIVATE METHODS 48 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 49 | 50 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 51 | 52 | void SoundTestState::constructor() 53 | { 54 | // Always explicitly call the base's constructor 55 | Base::constructor(); 56 | 57 | this->tool = Tool::safeCast(SoundTest::getInstance()); 58 | } 59 | 60 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 61 | 62 | void SoundTestState::destructor() 63 | { 64 | // Always explicitly call the base's destructor 65 | Base::destructor(); 66 | } 67 | 68 | //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 69 | 70 | #endif 71 | --------------------------------------------------------------------------------