add Unity project

This commit is contained in:
Stefan 2021-08-17 09:52:24 +02:00
parent 21eaf258c1
commit 6208912983
117 changed files with 13431 additions and 0 deletions

2
.gitignore vendored
View File

@ -2,6 +2,7 @@ compile_commands.json
.ccls-cache
elfy/.ccls-cache
rvc
!rvc/
*.o
elfy/target
elfy/Cargo.lock
@ -10,6 +11,7 @@ rust_payload/Cargo.lock
fw_payload.*
*.dtb
*.bmp
!_Nix/**/*.bmp
*.bin
*.elf
*.img

BIN
_Nix/128_exp_red.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

110
_Nix/128_exp_red.png.meta Executable file
View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: dd14b92b6d625184988b0188a4b8a991
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 0
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 3
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 3
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 3
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/128_exp_red_8.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

116
_Nix/128_exp_red_8.png.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 8081e27e90a915f439f05ec34cd7b269
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 0
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 3
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 3
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 3
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/128_red.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

110
_Nix/128_red.png.meta Executable file
View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: b4920b816de053648a7b261072fe296b
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 63
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 63
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 63
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

133
_Nix/AutoImport.cs Executable file
View File

@ -0,0 +1,133 @@
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections.Generic;
// increment to reimport: 6
#if UNITY_EDITOR
[InitializeOnLoad]
public static class AutoImport
{
private static List<string> FilesToWatch = new List<string>() {
"Assets\\_Nix\\rvc\\*",
"Assets\\_Nix\\rvc\\src\\*",
};
private static FileSystemWatcher[] watchers;
private static bool[] hasChange;
public static string PathToPerlPP = "Perl\\strawberry-perl-5.32.1.1-64bit-portable\\perl\\bin\\perl.exe Perl\\perlpp";
static AutoImport()
{
if (EditorApplication.isPlaying) return;
if (Application.isPlaying) return;
// resolve *
for (int i = 0; i < FilesToWatch.Count; i++)
{
var cur = FilesToWatch[i];
if (cur.EndsWith("*"))
{
FilesToWatch.RemoveAt(i);
i--;
foreach (var file in Directory.GetFiles(Path.GetDirectoryName(cur)))
{
if (file.EndsWith(".meta")) continue;
FilesToWatch.Add(file);
}
}
}
hasChange = new bool[FilesToWatch.Count];
watchers = new FileSystemWatcher[FilesToWatch.Count];
for (int i = 0; i < FilesToWatch.Count; i++)
{
hasChange[i] = false;
if (FilesToWatch[i].EndsWith(".h")) continue;
if (File.Exists(FilesToWatch[i] + ".pp"))
{
FilesToWatch[i] = FilesToWatch[i] + ".pp";
}
if (!File.Exists(FilesToWatch[i]))
{
Debug.LogWarning("[AutoImport] File doesn't exist: " + FilesToWatch[i]);
continue;
}
var path = Path.GetDirectoryName(FilesToWatch[i]);
var file = Path.GetFileName(FilesToWatch[i]);
Debug.Log("[AutoImport] Watching: " + path + "\\" + file);
watchers[i] = new FileSystemWatcher(path, file);
watchers[i].NotifyFilter = NotifyFilters.LastWrite;
watchers[i].Changed += createEventHandler(i);
watchers[i].EnableRaisingEvents = true;
}
EditorApplication.update += OnUpdate;
}
private static FileSystemEventHandler createEventHandler(int i)
{
return (object sender, FileSystemEventArgs args) =>
{
if (args.ChangeType == WatcherChangeTypes.Changed)
{
hasChange[i] = true;
}
};
}
static void OnUpdate()
{
if (EditorApplication.isPlaying) return;
if (Application.isPlaying) return;
for (int i = 0; i < hasChange.Length; i++)
{
if (hasChange[i])
{
Debug.Log("[AutoImport] Asset changed: " + FilesToWatch[i]);
hasChange[i] = false;
if (FilesToWatch[i].EndsWith(".pp"))
{
var gen = FilesToWatch[i].Substring(0, FilesToWatch[i].Length - 3);
RunPerlPP(FilesToWatch[i], gen);
AssetDatabase.ImportAsset(gen);
}
else
{
AssetDatabase.ImportAsset(FilesToWatch[i]);
}
}
}
}
static void RunPerlPP(string input, string output)
{
Debug.Log("[AutoImport] Running perlpp in " + System.Environment.CurrentDirectory);
var args = $"/C {PathToPerlPP} -o {output} {input}";
var p = new System.Diagnostics.Process
{
StartInfo = new System.Diagnostics.ProcessStartInfo(
@"cmd.exe",
args
)
{
WorkingDirectory = System.Environment.CurrentDirectory,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true
}
};
p.Start();
p.WaitForExit();
Debug.Log("[AutoImport] perlpp out: " + p.StandardOutput.ReadToEnd());
Debug.Log("[AutoImport] perlpp err: " + p.StandardError.ReadToEnd());
}
}
#endif

11
_Nix/AutoImport.cs.meta Executable file
View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6bdc17426a56c254e8feaccdd271248d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

1023
_Nix/NixControl.asset Executable file

File diff suppressed because it is too large Load Diff

8
_Nix/NixControl.asset.meta Executable file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8c616d737aeab2c44a64763eb46d4cfd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

130
_Nix/NixControl.cs Executable file
View File

@ -0,0 +1,130 @@
using UdonSharp;
using VRC.SDKBase;
using VRC.Udon;
using UnityEngine;
using UnityEngine.UI;
public class NixControl : UdonSharpBehaviour
{
public CustomRenderTexture CRT;
public UdonBehaviour Dial, Debug;
public Text StatusText;
public Text UartOut;
public Camera DebugCam;
private int curSec;
private int fps; // ups, really
private int frameCount;
private bool run;
public Slider TickSlider;
public Dropdown ProgramSelect;
public KeyboardManager2 Keyboard;
public NixProgramLoader[] Programs;
private NixProgramLoader CurProgram;
private int disableInit = 0;
void Start()
{
curSec = (int)Time.time;
fps = 0;
frameCount = 0;
CurProgram = Programs[0];
StatusText.supportRichText = true;
CRT.updateMode = CustomRenderTextureUpdateMode.OnDemand;
CRT.material.SetInt("_Init", 1);
CRT.material.SetInt("_DoTick", 1);
CRT.material.SetInt("_Ticks", (int)TickSlider.value);
run = false;
TickSliderChange();
}
void Update()
{
var sec = (int)Time.time;
if (sec != curSec)
{
fps = frameCount;
frameCount = 0;
}
curSec = sec;
frameCount++;
if (disableInit > 0) {
disableInit--;
if (disableInit == 0) {
CRT.material.SetInt("_Init", 0);
}
}
var stateT = !run ? "<color=yellow>reset/load</color>" : "<color=green>running</color>";
StatusText.text = $"State: {stateT}\n";
if (run)
{
var ticks = (int)TickSlider.value;
var fpsCol = fps < 40 ? "red" : "green";
StatusText.text += $"<i>{ticks}</i> (ticks) * " +
$"<i><color={fpsCol}>{fps}</color></i> (UPS/FPS) = <b>{ticks * fps}</b> IPS";
}
// DEBUG
// CRT.material.SetInt("_DoTick", CRT.material.GetInt("_DoTick") + 1);
}
public void DialEnable()
{
var state = (int)Dial.GetProgramVariable("NextState");
run = state == 1;
if (!run)
{
CurProgram.ApplyTexture();
CRT.material.SetInt("_DoTick", 1);
CRT.material.SetInt("_Init", 1);
Debug.SetProgramVariable("RenderCam", false);
Debug.SetProgramVariable("UartPtr", 0);
Debug.SetProgramVariable("UartTag", 0);
Debug.SetProgramVariable("newlines", 0);
Debug.SetProgramVariable("linelength", 0);
Debug.SetProgramVariable("LocalText", "");
CRT.material.SetInt("_UdonUARTInChar", 0);
CRT.material.SetInt("_UdonUARTInTag", 0);
CRT.material.SetInt("_UdonUARTPtr", 0);
UartOut.text = "";
Keyboard.queue = "";
CRT.updateMode = CustomRenderTextureUpdateMode.OnDemand;
}
else
{
CurProgram.ApplyTexture();
Debug.SetProgramVariable("RenderCam", true);
CRT.material.SetInt("_Init", 1);
disableInit = 2;
CRT.material.SetInt("_DoTick", 0);
CRT.updateMode = CustomRenderTextureUpdateMode.Realtime;
}
}
public void TickSliderChange()
{
CRT.material.SetInt("_Ticks", (int)TickSlider.value);
}
public void ProgramSelectChanged()
{
CurProgram.TurnOff();
CurProgram = Programs[ProgramSelect.value];
CurProgram.TurnOn();
CurProgram.ApplyTexture();
}
}

11
_Nix/NixControl.cs.meta Executable file
View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 32d551b771daedb4980227a82dc09b45
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

1682
_Nix/NixDebug.asset Executable file

File diff suppressed because it is too large Load Diff

8
_Nix/NixDebug.asset.meta Executable file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2c946f88bdb3ec94593852e93003b117
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

390
_Nix/NixDebug.cs Executable file
View File

@ -0,0 +1,390 @@
using System;
using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDKBase;
using VRC.Udon;
public class NixDebug : UdonSharpBehaviour
{
public Texture2D Buffer;
public Text DbgText;
public Text UartOut;
public Toggle EnableToggle;
public Material vm_mat;
public int UpdateEveryXFrames = 90;
public GameObject[] DebugObj;
private bool prevIsOn;
[HideInInspector]
public int UartPtr = 0;
private Camera cam;
private int lastUpdate = 0;
[HideInInspector]
public int newlines = 0;
[HideInInspector]
public int linelength = 0;
public int UartTag = 0;
public KeyboardManager2 Keyboard;
public string LocalText = "";
[UdonSynced]
public string MasterText;
public Text MasterTextbox;
private bool caret = false;
void Start()
{
cam = this.GetComponent<Camera>();
DbgText.supportRichText = true;
UartOut.supportRichText = false;
prevIsOn = !EnableToggle.isOn;
if (Networking.LocalPlayer.isMaster) {
MasterTextbox.text = "<you're master!>";
}
DebugSelectUpdate();
}
private const float MULT = 255.0f;
private const float ADD = 0.5f;
private uint decodePackedData(int x, int y, int c)
{
Color[] col = new Color[6] {
Buffer.GetPixel(x, y),
Buffer.GetPixel(x + 128, y),
Buffer.GetPixel(x + 128*2, y),
Buffer.GetPixel(x + 128*3, y),
Buffer.GetPixel(x + 128*4, y),
Buffer.GetPixel(x + 128*5, y)
};
switch (c) {
case 0:
return (
(uint)(col[0].r * MULT + ADD) |
((uint)(col[1].r * MULT + ADD) << 8) |
((uint)(col[2].r * MULT + ADD) << 16) |
((uint)(col[3].r * MULT + ADD) << 24)
);
case 1:
return (
(uint)(col[0].g * MULT + ADD) |
((uint)(col[1].g * MULT + ADD) << 8) |
((uint)(col[2].g * MULT + ADD) << 16) |
((uint)(col[3].g * MULT + ADD) << 24)
);
case 2:
return (
(uint)(col[0].b * MULT + ADD) |
((uint)(col[1].b * MULT + ADD) << 8) |
((uint)(col[2].b * MULT + ADD) << 16) |
((uint)(col[3].b * MULT + ADD) << 24)
);
case 3:
return (
(uint)(col[4].r * MULT + ADD) |
((uint)(col[4].g * MULT + ADD) << 8) |
((uint)(col[4].b * MULT + ADD) << 16) |
((uint)(col[5].r * MULT + ADD) << 24)
);
}
return 0;
}
private const int ANSI_SM_NONE = 0;
private const int ANSI_SM_ESC_RECEIVED = 1;
private const int ANSI_SM_CTRL_RECEIVED = 2;
private int ansi_escape_sm = 0;
public void DebugSelectUpdate()
{
if (EnableToggle.isOn != prevIsOn) {
foreach (var o in DebugObj)
{
o.SetActive(EnableToggle.isOn);
}
if (!EnableToggle.isOn) {
DbgText.text = "<disabled>";
} else {
DbgText.text = "Waiting for data...";
}
prevIsOn = EnableToggle.isOn;
}
}
public void OnPostRender()
{
Buffer.ReadPixels(new Rect(0, 120, 128*6, 8), 0, 0);
var newUartPtrRaw = load_uart_buffer__ptr();
var newUartPtr = (newUartPtrRaw >= 0U && newUartPtrRaw < (uint)UART_BUFFER_SIZE) ? (int)newUartPtrRaw : 0;
if (EnableToggle.isOn) {
// Enter single step mode when breakpoint detected
var dbgTick = load_debug_do_tick();
if (dbgTick == 0xffffffffU) {
vm_mat.SetInt("_DoTick", 1);
}
// var load_debug_arb_0x = load_debug_arb_0();
// var load_debug_arb_1x = load_debug_arb_1();
// var load_debug_arb_2x = load_debug_arb_2();
// var load_debug_arb_3x = load_debug_arb_3();
// var load_debug_arb_4x = load_debug_arb_4();
// var load_debug_arb_5x = load_debug_arb_5();
// var load_debug_arb_6x = load_debug_arb_6();
// var load_debug_arb_7x = load_debug_arb_7();
var pc = load_pc();
DbgText.text = $@"<b>stats:</b>
pc : 0x{pc.ToString("X8")}
instr. : 0x{load_debug_last_ins().ToString("X8")}
clock : {load_clock()}
stall : {load_debug_last_stall()}
#stall : {load_stall_count()}
#trap : {load_trap_count()}
#commit : {load_commits()}
priv. : {load_csr__privilege()}
uartptr : {UartPtr.ToString("X2")}/{newUartPtr.ToString("X2")}
mstatus : 0x{load_csr(0x300).ToString("X8")}
dbgtick : {dbgTick}
dbgarb0 : {load_debug_arb_0()}"
/*chkcsr : 0x{load_debug_csr_val().ToString("X8")}"
/*chkmem : 0x{load_debug_mem_val().ToString("X8")}*/ + $@"
<size=24>
zz=0x{load_xreg0().ToString("X8")} ra=0x{load_xreg1().ToString("X8")} sp=0x{load_xreg2().ToString("X8")} gp=0x{load_xreg3().ToString("X8")}
tp=0x{load_xreg4().ToString("X8")} t0=0x{load_xreg5().ToString("X8")} t1=0x{load_xreg6().ToString("X8")} t2=0x{load_xreg7().ToString("X8")}
fp=0x{load_xreg8().ToString("X8")} s1=0x{load_xreg9().ToString("X8")} a0=0x{load_xreg10().ToString("X8")} a1=0x{load_xreg11().ToString("X8")}
a2=0x{load_xreg12().ToString("X8")} a3=0x{load_xreg13().ToString("X8")} a4=0x{load_xreg14().ToString("X8")} a5=0x{load_xreg15().ToString("X8")}
a6=0x{load_xreg16().ToString("X8")} a7=0x{load_xreg17().ToString("X8")} s2=0x{load_xreg18().ToString("X8")} s3=0x{load_xreg19().ToString("X8")}
s4=0x{load_xreg20().ToString("X8")} s5=0x{load_xreg21().ToString("X8")} s6=0x{load_xreg22().ToString("X8")} s7=0x{load_xreg23().ToString("X8")}
s8=0x{load_xreg24().ToString("X8")} s9=0x{load_xreg25().ToString("X8")} 10=0x{load_xreg26().ToString("X8")} 11=0x{load_xreg27().ToString("X8")}
t3=0x{load_xreg28().ToString("X8")} t4=0x{load_xreg29().ToString("X8")} t5=0x{load_xreg30().ToString("X8")} t6=0x{load_xreg31().ToString("X8")}"
/*
arb0=0x{load_debug_arb_0x.ToString("X8")} arb1=0x{load_debug_arb_1x.ToString("X8")} arb2=0x{load_debug_arb_2x.ToString("X8")} arb3=0x{load_debug_arb_3x.ToString("X8")}
arb4=0x{load_debug_arb_4x.ToString("X8")} arb5=0x{load_debug_arb_5x.ToString("X8")} arb6=0x{load_debug_arb_6x.ToString("X8")} arb7=0x{load_debug_arb_7x.ToString("X8")}*/ + $@"
</size>
";
// ARB=0x{(load_debug_arb_0x ^ load_debug_arb_1x ^ load_debug_arb_2x ^ load_debug_arb_3x ^ load_debug_arb_4x ^ load_debug_arb_5x ^ load_debug_arb_6x ^ load_debug_arb_7x ^ pc).ToString("X8")}
}
var changed = false;
while (newUartPtr != UartPtr) {
UartPtr++;
if (UartPtr == UART_BUFFER_SIZE) { UartPtr = 0; }
var tmp = getUartBuffer(UartPtr);
if (tmp == 0) continue;
if (tmp == 8) { // backspace
if (linelength == 0) {
linelength = 79;
newlines--;
} else {
linelength--;
}
LocalText = LocalText.Substring(0, LocalText.Length - 1);
changed = true;
continue;
}
// Basic ANSI escape support
// TODO: implement correctly...
if (tmp == 27) { // ASCII ESC
ansi_escape_sm = ANSI_SM_ESC_RECEIVED;
continue;
}
if (ansi_escape_sm == ANSI_SM_ESC_RECEIVED) {
if (tmp == ((int)'[')) {
ansi_escape_sm = ANSI_SM_CTRL_RECEIVED;
} else {
ansi_escape_sm = ANSI_SM_NONE;
}
continue;
}
if (ansi_escape_sm == ANSI_SM_CTRL_RECEIVED) {
if (tmp >= 0x20 && tmp <= 0x3F) {
// data, ignored for now
} else {
// termination (or invalid)
ansi_escape_sm = ANSI_SM_NONE;
}
continue;
}
var c = (char)tmp;
LocalText += c;
changed = true;
if (c == '\n') {
newlines++;
linelength = 0;
} else {
linelength++;
if (linelength >= 80) {
linelength = 0;
newlines++;
LocalText += '\n';
}
}
if (newlines > 30) {
LocalText = LocalText.Substring(LocalText.IndexOf('\n') + 1);
newlines--;
}
}
vm_mat.SetInt("_UdonUARTPtr", UartPtr);
if (Networking.LocalPlayer.isMaster && changed) {
MasterText = LocalText;
this.RequestSerialization();
MasterTextbox.text = MasterText;
}
var caretStr = caret ? "█" : "";
caret = !caret;
UartOut.text = LocalText + caretStr;
var curTag = load_uart__input_tag();
if (curTag == UartTag) {
Keyboard.CharToVM();
}
// DEBUG
//Debug.Log("TRACE: 0x" + load_debug_last_ins().ToString("X8") + " @ " + load_pc().ToString("X8"));
// Debug.Log("TEST begin");
// int prev = -1;
// for (int i = 0; i < 256; i++) {
// px = decodePackedColor(i % 128, i / 128);
// if (px[0] != prev + 1) {
// Debug.Log("DISCREPANCY! @" + i + " got: " + px[0] + " wanted: " + (prev + 1) + " dbg: " + prev2);
// }
// prev = (int)px[0];
// }
// Debug.Log("TEST done");
}
public bool RenderCam = false;
void Update()
{
if (cam.enabled)
{
cam.enabled = false;
}
lastUpdate--;
if (lastUpdate <= 0)
{
cam.enabled = RenderCam;
lastUpdate = UpdateEveryXFrames;
}
}
public override void OnDeserialization()
{
MasterTextbox.text = MasterText;
}
// auto-generated in 'types.h':
#region LOAD
private const int UART_BUFFER_SIZE = 64;
private int[] addr_lin(int lin) {
int[] ret = new int[3];
ret[2] = lin & 0x3; // c
lin = lin >> 2;
ret[0] = lin % 128; // x
ret[1] = lin / 128; // y
return ret;
}
private uint load_csr__privilege() { return decodePackedData(48, 0, 2); }
private uint load_uart__rbr_thr_ier_iir() { return decodePackedData(48, 0, 3); }
private uint load_uart__lcr_mcr_lsr_scr() { return decodePackedData(49, 0, 0); }
private uint load_uart__thre_ip() { return decodePackedData(49, 0, 1); }
private uint load_uart__interrupting() { return decodePackedData(49, 0, 2); }
private uint load_uart__input_tag() { return decodePackedData(49, 0, 3); }
private uint load_clint__msip() { return decodePackedData(50, 0, 0); }
private uint load_clint__mtimecmp_lo() { return decodePackedData(50, 0, 1); }
private uint load_clint__mtimecmp_hi() { return decodePackedData(50, 0, 2); }
private uint load_clint__mtime_lo() { return decodePackedData(50, 0, 3); }
private uint load_clint__mtime_hi() { return decodePackedData(51, 0, 0); }
private uint load_uart_buffer__ptr() { return decodePackedData(51, 0, 1); }
private uint load_mmu__mode() { return decodePackedData(67, 0, 2); }
private uint load_mmu__ppn() { return decodePackedData(67, 0, 3); }
private uint load_stall() { return decodePackedData(68, 0, 0); }
private uint load_clock() { return decodePackedData(68, 0, 1); }
private uint load_commits() { return decodePackedData(68, 0, 2); }
private uint load_xreg0() { return decodePackedData(68, 0, 3); }
private uint load_xreg1() { return decodePackedData(69, 0, 0); }
private uint load_xreg2() { return decodePackedData(69, 0, 1); }
private uint load_xreg3() { return decodePackedData(69, 0, 2); }
private uint load_xreg4() { return decodePackedData(69, 0, 3); }
private uint load_xreg5() { return decodePackedData(70, 0, 0); }
private uint load_xreg6() { return decodePackedData(70, 0, 1); }
private uint load_xreg7() { return decodePackedData(70, 0, 2); }
private uint load_xreg8() { return decodePackedData(70, 0, 3); }
private uint load_xreg9() { return decodePackedData(71, 0, 0); }
private uint load_xreg10() { return decodePackedData(71, 0, 1); }
private uint load_xreg11() { return decodePackedData(71, 0, 2); }
private uint load_xreg12() { return decodePackedData(71, 0, 3); }
private uint load_xreg13() { return decodePackedData(72, 0, 0); }
private uint load_xreg14() { return decodePackedData(72, 0, 1); }
private uint load_xreg15() { return decodePackedData(72, 0, 2); }
private uint load_xreg16() { return decodePackedData(72, 0, 3); }
private uint load_xreg17() { return decodePackedData(73, 0, 0); }
private uint load_xreg18() { return decodePackedData(73, 0, 1); }
private uint load_xreg19() { return decodePackedData(73, 0, 2); }
private uint load_xreg20() { return decodePackedData(73, 0, 3); }
private uint load_xreg21() { return decodePackedData(74, 0, 0); }
private uint load_xreg22() { return decodePackedData(74, 0, 1); }
private uint load_xreg23() { return decodePackedData(74, 0, 2); }
private uint load_xreg24() { return decodePackedData(74, 0, 3); }
private uint load_xreg25() { return decodePackedData(75, 0, 0); }
private uint load_xreg26() { return decodePackedData(75, 0, 1); }
private uint load_xreg27() { return decodePackedData(75, 0, 2); }
private uint load_xreg28() { return decodePackedData(75, 0, 3); }
private uint load_xreg29() { return decodePackedData(76, 0, 0); }
private uint load_xreg30() { return decodePackedData(76, 0, 1); }
private uint load_xreg31() { return decodePackedData(76, 0, 2); }
private uint load_pc() { return decodePackedData(76, 0, 3); }
private uint load_reservation_en() { return decodePackedData(77, 0, 0); }
private uint load_reservation_addr() { return decodePackedData(77, 0, 1); }
private uint load_memop_src_v() { return decodePackedData(77, 0, 2); }
private uint load_memop_dst_v() { return decodePackedData(77, 0, 3); }
private uint load_memop_src_p() { return decodePackedData(78, 0, 0); }
private uint load_memop_dst_p() { return decodePackedData(78, 0, 1); }
private uint load_memop_n() { return decodePackedData(78, 0, 2); }
private uint load_stall_count() { return decodePackedData(78, 0, 3); }
private uint load_trap_count() { return decodePackedData(79, 0, 0); }
private uint load_debug_do_tick() { return decodePackedData(79, 0, 1); }
private uint load_debug_last_ins() { return decodePackedData(79, 0, 2); }
private uint load_debug_last_stall() { return decodePackedData(79, 0, 3); }
private uint load_debug_arb_0() { return decodePackedData(80, 0, 0); }
private uint load_csr(int addr) {
int lin = (addr >> 2) + 324;
return decodePackedData(lin % 128, lin / 128, addr & 0x3);
}
private uint getUartBuffer(int idx) {
int lin = idx + 206;
int[] acc = addr_lin(lin);
return decodePackedData(acc[0], acc[1], acc[2]);
}
#endregion
}

11
_Nix/NixDebug.cs.meta Executable file
View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 71e2d556b88cc8247b0e36e78a72e458
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

385
_Nix/NixProgramLoader.asset Executable file
View File

@ -0,0 +1,385 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: NixProgramLoader
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 8650e8273137edb428534549230f3d6e,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: b54997385532bd84d88ee0b5ac0c37d1, type: 3}
behaviourSyncMode: 0
behaviourIDHeapVarName: __refl_const_intnl_udonTypeID
compileErrors: []
hasInteractEvent: 0
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: fieldDefinitions
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
UdonSharp.Editor]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 6
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: vm_mat
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: fieldSymbol
Entry: 7
Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor
- Name: internalType
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Material, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: declarationType
Entry: 3
Data: 1
- Name: syncMode
Entry: 3
Data: 0
- Name: symbolResolvedTypeName
Entry: 1
Data: UnityEngineMaterial
- Name: symbolOriginalName
Entry: 1
Data: vm_mat
- Name: symbolUniqueName
Entry: 1
Data: vm_mat
- Name: symbolDefaultValue
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name: userBehaviourSource
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: TexR
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: fieldSymbol
Entry: 7
Data: 7|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor
- Name: internalType
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Texture2D, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: declarationType
Entry: 3
Data: 1
- Name: syncMode
Entry: 3
Data: 0
- Name: symbolResolvedTypeName
Entry: 1
Data: UnityEngineTexture2D
- Name: symbolOriginalName
Entry: 1
Data: TexR
- Name: symbolUniqueName
Entry: 1
Data: TexR
- Name: symbolDefaultValue
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: fieldAttributes
Entry: 7
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name: userBehaviourSource
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: TexG
- Name: $v
Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: fieldSymbol
Entry: 7
Data: 11|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor
- Name: internalType
Entry: 9
Data: 8
- Name: declarationType
Entry: 3
Data: 1
- Name: syncMode
Entry: 3
Data: 0
- Name: symbolResolvedTypeName
Entry: 1
Data: UnityEngineTexture2D
- Name: symbolOriginalName
Entry: 1
Data: TexG
- Name: symbolUniqueName
Entry: 1
Data: TexG
- Name: symbolDefaultValue
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: fieldAttributes
Entry: 9
Data: 9
- Name: userBehaviourSource
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: TexB
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: fieldSymbol
Entry: 7
Data: 13|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor
- Name: internalType
Entry: 9
Data: 8
- Name: declarationType
Entry: 3
Data: 1
- Name: syncMode
Entry: 3
Data: 0
- Name: symbolResolvedTypeName
Entry: 1
Data: UnityEngineTexture2D
- Name: symbolOriginalName
Entry: 1
Data: TexB
- Name: symbolUniqueName
Entry: 1
Data: TexB
- Name: symbolDefaultValue
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: fieldAttributes
Entry: 9
Data: 9
- Name: userBehaviourSource
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: TexA
- Name: $v
Entry: 7
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: fieldSymbol
Entry: 7
Data: 15|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor
- Name: internalType
Entry: 9
Data: 8
- Name: declarationType
Entry: 3
Data: 1
- Name: syncMode
Entry: 3
Data: 0
- Name: symbolResolvedTypeName
Entry: 1
Data: UnityEngineTexture2D
- Name: symbolOriginalName
Entry: 1
Data: TexA
- Name: symbolUniqueName
Entry: 1
Data: TexA
- Name: symbolDefaultValue
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: fieldAttributes
Entry: 9
Data: 9
- Name: userBehaviourSource
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: InfoObjects
- Name: $v
Entry: 7
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: fieldSymbol
Entry: 7
Data: 17|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor
- Name: internalType
Entry: 7
Data: 18|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: declarationType
Entry: 3
Data: 1
- Name: syncMode
Entry: 3
Data: 0
- Name: symbolResolvedTypeName
Entry: 1
Data: UnityEngineGameObjectArray
- Name: symbolOriginalName
Entry: 1
Data: InfoObjects
- Name: symbolUniqueName
Entry: 1
Data: InfoObjects
- Name: symbolDefaultValue
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: fieldAttributes
Entry: 7
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name: userBehaviourSource
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4ae4a0e40c47621469a19968e15c1a65
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

42
_Nix/NixProgramLoader.cs Executable file
View File

@ -0,0 +1,42 @@

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class NixProgramLoader : UdonSharpBehaviour
{
public Material vm_mat;
public Texture2D TexR, TexG, TexB, TexA;
public GameObject[] InfoObjects;
public void TurnOn()
{
if (InfoObjects != null && InfoObjects.Length > 0) {
foreach (var obj in InfoObjects)
{
obj.SetActive(true);
}
}
}
public void TurnOff()
{
if (InfoObjects != null && InfoObjects.Length > 0) {
foreach (var obj in InfoObjects)
{
obj.SetActive(false);
}
}
}
public void ApplyTexture()
{
vm_mat.SetTexture("_Data_RAM_R", TexR);
vm_mat.SetTexture("_Data_RAM_G", TexG);
vm_mat.SetTexture("_Data_RAM_B", TexB);
vm_mat.SetTexture("_Data_RAM_A", TexA);
}
}

16
_Nix/NixProgramLoader.cs.meta Executable file
View File

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: b54997385532bd84d88ee0b5ac0c37d1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- vm_mat: {fileID: 2100000, guid: 8d3d8704dc0acc64ababc7c4712d3cb7, type: 2}
- TexR: {instanceID: 0}
- TexG: {instanceID: 0}
- TexB: {instanceID: 0}
- TexA: {instanceID: 0}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

178
_Nix/NixStep.asset Executable file
View File

@ -0,0 +1,178 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: NixStep
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 6719c4d62d3774e459264cf7e7cbf4d9,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 0b694aab2de238449883e34697e36152, type: 3}
behaviourSyncMode: 0
behaviourIDHeapVarName: __refl_const_intnl_udonTypeID
compileErrors: []
hasInteractEvent: 1
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: fieldDefinitions
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
UdonSharp.Editor]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 2
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: vm_mat
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: fieldSymbol
Entry: 7
Data: 3|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor
- Name: internalType
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Material, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: declarationType
Entry: 3
Data: 1
- Name: syncMode
Entry: 3
Data: 0
- Name: symbolResolvedTypeName
Entry: 1
Data: UnityEngineMaterial
- Name: symbolOriginalName
Entry: 1
Data: vm_mat
- Name: symbolUniqueName
Entry: 1
Data: vm_mat
- Name: symbolDefaultValue
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name: userBehaviourSource
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: Off
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: fieldSymbol
Entry: 7
Data: 7|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor
- Name: internalType
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: declarationType
Entry: 3
Data: 1
- Name: syncMode
Entry: 3
Data: 0
- Name: symbolResolvedTypeName
Entry: 1
Data: SystemBoolean
- Name: symbolOriginalName
Entry: 1
Data: Off
- Name: symbolUniqueName
Entry: 1
Data: Off
- Name: symbolDefaultValue
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: fieldAttributes
Entry: 7
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name: userBehaviourSource
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

8
_Nix/NixStep.asset.meta Executable file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 391b5e5315805c0489a96322f8580075
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

19
_Nix/NixStep.cs Executable file
View File

@ -0,0 +1,19 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class NixStep : UdonSharpBehaviour
{
public Material vm_mat;
public bool Off;
void Start()
{
}
public override void Interact()
{
vm_mat.SetInt("_DoTick", Off ? 0 : vm_mat.GetInt("_DoTick") + 1);
}
}

11
_Nix/NixStep.cs.meta Executable file
View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0b694aab2de238449883e34697e36152
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

94
_Nix/debug_cam_mat.mat Executable file
View File

@ -0,0 +1,94 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: debug_cam_mat
m_Shader: {fileID: 4800000, guid: 0d9402df573cc2d41a7b91aba5bc16bb, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex:
m_Texture: {fileID: 8400000, guid: e33729d34c6969d4abf57f63fd08aaf3, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex0:
m_Texture: {fileID: 8400000, guid: e33729d34c6969d4abf57f63fd08aaf3, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex1:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Sel: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

8
_Nix/debug_cam_mat.mat.meta Executable file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c565aff74cba93e43b71cad33d96c730
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

34
_Nix/debug_cam_rt.renderTexture Executable file
View File

@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: debug_cam_rt
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 768
m_Height: 128
m_AntiAliasing: 1
m_DepthFormat: 1
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 0
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e33729d34c6969d4abf57f63fd08aaf3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

48
_Nix/display.shader Executable file
View File

@ -0,0 +1,48 @@
Shader "Nix/Display"
{
Properties
{
_Tex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#include "rvc/helpers.cginc"
#pragma target 5.0
#pragma vertex vert_ortho_fullscreen
#pragma fragment frag
Texture2D<uint4> _Tex;
float4 frag(v2f i) : SV_Target {
uint2 dim;
_Tex.GetDimensions(dim.x, dim.y);
if (is_ortho) {
// FIXME: state size is hardcoded here...
uint2 pos = (i.uv * (uint2(128, 128) * uint2(6, 1))) % uint2(128, 128);
uint4 data = _Tex[pos];
// output packed values, stretched along x
float3 res[6];
pack_uint4(data, res);
uint idx = (uint)(i.uv.x * 6);
return float4(res[idx], 1);
} else {
uint2 pos = i.uv * dim;
uint4 data = _Tex[pos];
return float4(uint_to_color(data).rgb, 1);
}
}
ENDCG
}
}
}

9
_Nix/display.shader.meta Executable file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0d9402df573cc2d41a7b91aba5bc16bb
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

8
_Nix/rvc.meta Executable file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 549ce47b66f4d124ba2980043e6a844d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

88
_Nix/rvc/console.shader Executable file
View File

@ -0,0 +1,88 @@
Shader "Nix/console"
{
Properties
{
_BGColor ("Background Color", Color) = (0, 0, 0, 1)
_FGColor ("Foreground Color", Color) = (0, 1, 0, 1)
_Font ("Font Atlas", 2D) = "white" {}
_RVC ("The RVC state texture", 2D) = "black" {}
_FB_Width ("Framebuffer width (chars)", Int) = 80
_FB_Height ("Framebuffer height (chars)", Int) = 60
_Atlas_Width ("Atlas width (chars)", Int) = 64
_Atlas_Height ("Atlas height (chars)", Int) = 8
_CharBorder ("Character Border", Range(0, 1)) = 0.1
}
SubShader
{
Tags { "RenderType"="Opaque" }
Cull Off
Blend One Zero
Pass
{
CGPROGRAM
#pragma target 5.0
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _BGColor, _FGColor;
sampler2D _Font;
Texture2D<uint4> _RVC;
#define STATE_TEX _RVC
uint _FB_Width, _FB_Height;
uint _Atlas_Width, _Atlas_Height;
float _CharBorder;
#include "helpers.cginc"
#include "src/types.h"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
static uint2 s_dim;
float4 frag(v2f i) : SV_Target {
STATE_TEX.GetDimensions(s_dim.x, s_dim.y);
uint2 fb_idx = uint2(_FB_Width * i.uv.x, _FB_Height * i.uv.y);
float2 char_pos = frac(i.uv * float2(_FB_Width, _FB_Height));
char_pos *= 1.0 + _CharBorder;
char_pos -= _CharBorder * 0.5;
if (char_pos.x < 0.04 || char_pos.y < 0.04 || char_pos.x > 0.96 || char_pos.y > 0.96)
return _BGColor;
/* uint c = get_fb_char(fb_idx); */
uint c = '7';
float2 atlas_offset = float2(c % _Atlas_Width, (c / _Atlas_Width) + 1) *
float2(1.0/_Atlas_Width, 1.0/_Atlas_Height);
atlas_offset.y = 1 - atlas_offset.y;
float2 true_uv = atlas_offset + (char_pos * float2(1.0/_Atlas_Width, 1.0/_Atlas_Height));
float4 font_mask = tex2D(_Font, true_uv);
return lerp(_BGColor, _FGColor, font_mask.r);
}
ENDCG
}
}
}

9
_Nix/rvc/console.shader.meta Executable file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d796569aa1de841459cda4c17737c5cc
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

227
_Nix/rvc/crt.cginc Executable file
View File

@ -0,0 +1,227 @@
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// modified: change _SelfTexture2D to Texture2D<uint4>, from sampler2D
#ifndef UNITY_CUSTOM_TEXTURE_INCLUDED
#define UNITY_CUSTOM_TEXTURE_INCLUDED
#include "UnityCG.cginc"
#include "UnityStandardConfig.cginc"
// Keep in sync with CustomRenderTexture.h
#define kCustomTextureBatchSize 16
struct appdata_customrendertexture
{
uint vertexID : SV_VertexID;
};
// User facing vertex to fragment shader structure
struct v2f_customrendertexture
{
float4 vertex : SV_POSITION;
float3 localTexcoord : TEXCOORD0; // Texcoord local to the update zone (== globalTexcoord if no partial update zone is specified)
float3 globalTexcoord : TEXCOORD1; // Texcoord relative to the complete custom texture
uint primitiveID : TEXCOORD2; // Index of the update zone (correspond to the index in the updateZones of the Custom Texture)
float3 direction : TEXCOORD3; // For cube textures, direction of the pixel being rendered in the cubemap
};
float2 CustomRenderTextureRotate2D(float2 pos, float angle)
{
float sn = sin(angle);
float cs = cos(angle);
return float2( pos.x * cs - pos.y * sn, pos.x * sn + pos.y * cs);
}
// Internal
float4 CustomRenderTextureCenters[kCustomTextureBatchSize];
float4 CustomRenderTextureSizesAndRotations[kCustomTextureBatchSize];
float CustomRenderTexturePrimitiveIDs[kCustomTextureBatchSize];
float4 CustomRenderTextureParameters;
#define CustomRenderTextureUpdateSpace CustomRenderTextureParameters.x // Normalized(0)/PixelSpace(1)
#define CustomRenderTexture3DTexcoordW CustomRenderTextureParameters.y
#define CustomRenderTextureIs3D CustomRenderTextureParameters.z
// User facing uniform variables
float4 _CustomRenderTextureInfo; // x = width, y = height, z = depth, w = face/3DSlice
// Helpers
#define _CustomRenderTextureWidth _CustomRenderTextureInfo.x
#define _CustomRenderTextureHeight _CustomRenderTextureInfo.y
#define _CustomRenderTextureDepth _CustomRenderTextureInfo.z
// Those two are mutually exclusive so we can use the same slot
#define _CustomRenderTextureCubeFace _CustomRenderTextureInfo.w
#define _CustomRenderTexture3DSlice _CustomRenderTextureInfo.w
Texture2D<uint4> _SelfTexture2D;
samplerCUBE _SelfTextureCube;
sampler3D _SelfTexture3D;
float3 CustomRenderTextureComputeCubeDirection(float2 globalTexcoord)
{
float2 xy = globalTexcoord * 2.0 - 1.0;
float3 direction;
if(_CustomRenderTextureCubeFace == 0.0)
{
direction = normalize(float3(1.0, -xy.y, -xy.x));
}
else if(_CustomRenderTextureCubeFace == 1.0)
{
direction = normalize(float3(-1.0, -xy.y, xy.x));
}
else if(_CustomRenderTextureCubeFace == 2.0)
{
direction = normalize(float3(xy.x, 1.0, xy.y));
}
else if(_CustomRenderTextureCubeFace == 3.0)
{
direction = normalize(float3(xy.x, -1.0, -xy.y));
}
else if(_CustomRenderTextureCubeFace == 4.0)
{
direction = normalize(float3(xy.x, -xy.y, 1.0));
}
else if(_CustomRenderTextureCubeFace == 5.0)
{
direction = normalize(float3(-xy.x, -xy.y, -1.0));
}
return direction;
}
// standard custom texture vertex shader that should always be used
v2f_customrendertexture CustomRenderTextureVertexShader(appdata_customrendertexture IN)
{
v2f_customrendertexture OUT;
#if UNITY_UV_STARTS_AT_TOP
const float2 vertexPositions[6] =
{
{ -1.0f, 1.0f },
{ -1.0f, -1.0f },
{ 1.0f, -1.0f },
{ 1.0f, 1.0f },
{ -1.0f, 1.0f },
{ 1.0f, -1.0f }
};
const float2 texCoords[6] =
{
{ 0.0f, 0.0f },
{ 0.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 0.0f },
{ 0.0f, 0.0f },
{ 1.0f, 1.0f }
};
#else
const float2 vertexPositions[6] =
{
{ 1.0f, 1.0f },
{ -1.0f, -1.0f },
{ -1.0f, 1.0f },
{ -1.0f, -1.0f },
{ 1.0f, 1.0f },
{ 1.0f, -1.0f }
};
const float2 texCoords[6] =
{
{ 1.0f, 1.0f },
{ 0.0f, 0.0f },
{ 0.0f, 1.0f },
{ 0.0f, 0.0f },
{ 1.0f, 1.0f },
{ 1.0f, 0.0f }
};
#endif
uint primitiveID = IN.vertexID / 6;
uint vertexID = IN.vertexID % 6;
float3 updateZoneCenter = CustomRenderTextureCenters[primitiveID].xyz;
float3 updateZoneSize = CustomRenderTextureSizesAndRotations[primitiveID].xyz;
float rotation = CustomRenderTextureSizesAndRotations[primitiveID].w * UNITY_PI / 180.0f;
#if !UNITY_UV_STARTS_AT_TOP
rotation = -rotation;
#endif
// Normalize rect if needed
if (CustomRenderTextureUpdateSpace > 0.0) // Pixel space
{
// Normalize xy because we need it in clip space.
updateZoneCenter.xy /= _CustomRenderTextureInfo.xy;
updateZoneSize.xy /= _CustomRenderTextureInfo.xy;
}
else // normalized space
{
// Un-normalize depth because we need actual slice index for culling
updateZoneCenter.z *= _CustomRenderTextureInfo.z;
updateZoneSize.z *= _CustomRenderTextureInfo.z;
}
// Compute rotation
// Compute quad vertex position
float2 clipSpaceCenter = updateZoneCenter.xy * 2.0 - 1.0;
float2 pos = vertexPositions[vertexID] * updateZoneSize.xy;
pos = CustomRenderTextureRotate2D(pos, rotation);
pos.x += clipSpaceCenter.x;
#if UNITY_UV_STARTS_AT_TOP
pos.y += clipSpaceCenter.y;
#else
pos.y -= clipSpaceCenter.y;
#endif
// For 3D texture, cull quads outside of the update zone
// This is neeeded in additional to the preliminary minSlice/maxSlice done on the CPU because update zones can be disjointed.
// ie: slices [1..5] and [10..15] for two differents zones so we need to cull out slices 0 and [6..9]
if (CustomRenderTextureIs3D > 0.0)
{
int minSlice = (int)(updateZoneCenter.z - updateZoneSize.z * 0.5);
int maxSlice = minSlice + (int)updateZoneSize.z;
if (_CustomRenderTexture3DSlice < minSlice || _CustomRenderTexture3DSlice >= maxSlice)
{
pos.xy = float2(1000.0, 1000.0); // Vertex outside of ncs
}
}
OUT.vertex = float4(pos, 0.0, 1.0);
OUT.primitiveID = asuint(CustomRenderTexturePrimitiveIDs[primitiveID]);
OUT.localTexcoord = float3(texCoords[vertexID], CustomRenderTexture3DTexcoordW);
OUT.globalTexcoord = float3(pos.xy * 0.5 + 0.5, CustomRenderTexture3DTexcoordW);
#if UNITY_UV_STARTS_AT_TOP
OUT.globalTexcoord.y = 1.0 - OUT.globalTexcoord.y;
#endif
OUT.direction = CustomRenderTextureComputeCubeDirection(OUT.globalTexcoord.xy);
return OUT;
}
struct appdata_init_customrendertexture
{
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
};
// User facing vertex to fragment structure for initialization materials
struct v2f_init_customrendertexture
{
float4 vertex : SV_POSITION;
float3 texcoord : TEXCOORD0;
float3 direction : TEXCOORD1;
};
// standard custom texture vertex shader that should always be used for initialization shaders
v2f_init_customrendertexture InitCustomRenderTextureVertexShader (appdata_init_customrendertexture v)
{
v2f_init_customrendertexture o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.texcoord = float3(v.texcoord.xy, CustomRenderTexture3DTexcoordW);
o.direction = CustomRenderTextureComputeCubeDirection(v.texcoord.xy);
return o;
}
#endif // UNITY_CUSTOM_TEXTURE_INCLUDED

9
_Nix/rvc/crt.cginc.meta Executable file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 4332e0e4cd17f2948beb88edbe8c41dc
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

8
_Nix/rvc/data.meta Executable file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a7fb73cdccdb3e8458b28b2819da3ba6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/bare.a.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

116
_Nix/rvc/data/bare.a.bmp.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: ef865f3ad3e5a0e459ca5ea2f593171a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/bare.b.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

116
_Nix/rvc/data/bare.b.bmp.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: ef13138e4e45afb40af3457a57b13281
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/bare.g.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

116
_Nix/rvc/data/bare.g.bmp.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 06d3b119e472e914db5e6d229861ceeb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/bare.r.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

116
_Nix/rvc/data/bare.r.bmp.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 7fb6151407532aa4fb764bf062abfd95
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/dts.a.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

116
_Nix/rvc/data/dts.a.bmp.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: b79088bde5219a84994c413765be2fc5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/dts.b.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

116
_Nix/rvc/data/dts.b.bmp.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 113ecc14420d26b40bd84a317752e413
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/dts.g.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

116
_Nix/rvc/data/dts.g.bmp.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 6a4ccabd039d33640a175ee46ff45f7c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/dts.r.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

116
_Nix/rvc/data/dts.r.bmp.meta Executable file
View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 41d3eb80306a6fd4f8aa6ff80c39c0a5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/linux_payload.a.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 2e7c56c1f22f0814086f5d7a6f50221e
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/linux_payload.b.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: b1117b2ed49c12e4ebf9cb32a4ac299f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/linux_payload.g.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 732492b0fcc64074c8303725042915e9
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/linux_payload.r.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 116e2052555d2874ab5a308ea8b65e16
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/mprv_payload.a.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: b5e0c1f09cbd7254e9014d558c3d52a5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/mprv_payload.b.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: b4ec3122870c47a4d9767787b7de8d9f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/mprv_payload.g.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: ab6fe74eb0b04d045b6bbd9a46824a6d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/mprv_payload.r.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: a1cbe6c7cc3224f46aa6e90fc55c6725
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/rust_payload.a.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: a791f5afa4522d942a73fd07c4dcb65a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/rust_payload.b.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 930c7bf438045694485e81e75156474f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/rust_payload.g.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 37b500d8dc755314b9640d3efa58d023
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
_Nix/rvc/data/rust_payload.r.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: a58002ff0acde4e4da9028b14ca32746
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

95
_Nix/rvc/helpers.cginc Executable file
View File

@ -0,0 +1,95 @@
static bool is_ortho = unity_OrthoParams.w;
uint2 prev_pos(in uint2 pos, in uint2 dim) {
return uint2(
(pos.x == 0 ? dim.x : pos.x) - 1,
(pos.x == 0 ? ((pos.y == 0 ? dim.y : pos.y) - 1) : pos.y)
);
}
uint2 next_pos(in uint2 pos, in uint2 dim) {
return uint2(
pos.x == (dim.x - 1) ? 0 : dim.x + 1,
pos.x == (dim.x - 1) ? (pos.y == (dim.y - 1) ? 0 : dim.y - 1) : pos.y
);
}
uint idx_uint4(uint4 data, uint idx) {
[flatten]
switch (idx) {
case 0:
return data.x;
case 1:
return data.y;
case 2:
return data.z;
default:
return data.w;
}
}
struct v2f {
float4 vertex : SV_Position;
float2 uv : TEXCOORD0;
};
v2f vert_ortho_fullscreen(appdata_base v) {
v2f o;
o.vertex = is_ortho ?
float4((v.texcoord.xy-0.5f)*2, 0, 1) :
UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
#if UNITY_UV_STARTS_AT_TOP
o.uv.y = 1 - o.uv.y;
#endif
return o;
}
uint4 color_to_uint(float4 col) {
float m = (float)(~(uint)0);
return uint4(
col.r * m,
col.g * m,
col.b * m,
col.a * m
);
}
float4 uint_to_color(uint4 data) {
float div = (float)(~(uint)0);
float4 conv = float4(
data.r / div,
data.g / div,
data.b / div,
data.a / div
);
return conv;
}
#define PACK_MASK 0xFF
#define PACK_SHIFT 8
void pack_uint4(in uint4 data, out float3 result[6]) {
result[0] = (data.rgb & PACK_MASK) / 255.0f;
result[1] = ((data.rgb >> PACK_SHIFT) & PACK_MASK) / 255.0f;
result[2] = ((data.rgb >> (PACK_SHIFT*2)) & PACK_MASK) / 255.0f;
result[3] = ((data.rgb >> (PACK_SHIFT*3)) & PACK_MASK) / 255.0f;
result[4].r = (data.a & PACK_MASK) / 255.0f;
result[4].g = ((data.a >> PACK_SHIFT) & PACK_MASK) / 255.0f;
result[4].b = ((data.a >> (PACK_SHIFT*2)) & PACK_MASK) / 255.0f;
result[5].r = ((data.a >> (PACK_SHIFT*3)) & PACK_MASK) / 255.0f;
result[5].gb = 0;
}
#undef PACK_SHIFT
#undef PACK_MASK
uint unpack_raw_float4(in float4 data) {
uint res = 0;
res |= uint(data.a*255.0f+0.5f) << 24;
res |= uint(data.b*255.0f+0.5f) << 16;
res |= uint(data.g*255.0f+0.5f) << 8;
res |= uint(data.r*255.0f+0.5f);
return res;
}

9
_Nix/rvc/helpers.cginc.meta Executable file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: bcabc7a6d67e32c49bf22ab954e4bd0d
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

168
_Nix/rvc/main.shader Executable file
View File

@ -0,0 +1,168 @@
Shader "Nix/rvc"
{
Properties
{
[ToggleUI] _Init ("Init", float) = 0
[ToggleUI] _InitRaw ("Init directly from _Data_RAM_RAW", float) = 0
_Ticks ("Ticks per Frame", Int) = 1024
_TicksDivisor ("Tick Divisor", Int) = 4
_UdonUARTPtr ("UART ptr on Udon side", Int) = 0
_UdonUARTInChar ("UART input Udon side", Int) = 0
_UdonUARTInTag ("UART input unique tag", Int) = 0
_Data_RAM_R ("RAM Texture R", 2D) = "black" {}
_Data_RAM_G ("RAM Texture G", 2D) = "black" {}
_Data_RAM_B ("RAM Texture B", 2D) = "black" {}
_Data_RAM_A ("RAM Texture A", 2D) = "black" {}
_Data_RAM_RAW ("RAM Texture RAW", 2D) = "black" {}
_Data_DTB_R ("Device Tree Binary Texture R", 2D) = "black" {}
_Data_DTB_G ("Device Tree Binary Texture G", 2D) = "black" {}
_Data_DTB_B ("Device Tree Binary Texture B", 2D) = "black" {}
_Data_DTB_A ("Device Tree Binary Texture A", 2D) = "black" {}
_DoTick ("DEBUG: Perform single step", Int) = 0
/* _BreakpointLow ("DEBUG: Breakpoint: Enter single step mode at this PC address (low 16)", Int) = 0 */
/* _BreakpointHigh ("DEBUG: Breakpoint: Enter single step mode at this PC address (high 16)", Int) = 0 */
/* _BreakpointLowClock ("DEBUG: Breakpoint: Enter single step mode at this clock (low 16)", Int) = 0 */
/* _BreakpointHighClock ("DEBUG: Breakpoint: Enter single step mode at this clock (high 16)", Int) = 0 */
/* _CheckCSR ("DEBUG: Display CSR", Int) = 0 */
/* _CheckMEM ("DEBUG: Display RAM", Int) = 0 */
/* [ToggleUI] _CheckMEMraw ("DEBUG: Display RAM raw (not | 0x80000000)", Int) = 0 */
}
SubShader
{
Tags { "RenderType"="Opaque" "IgnoreProjector"="true" }
Cull Off
ZTest Off
Lighting Off
Blend One Zero
Pass
{
Name "CPUTick"
CGPROGRAM
#pragma target 5.0
#pragma vertex CustomRenderTextureVertexShader
#pragma fragment frag
#define PASS_TICK
// custom crt include w/ Texture2D<uint4> self-reference
#include "crt.cginc"
#include "UnityCG.cginc"
uniform uint _Init, _InitRaw;
uniform uint _Ticks, _TicksDivisor;
uniform uint _UdonUARTPtr, _UdonUARTInChar, _UdonUARTInTag;
uniform uint _DoTick;
/* uniform uint _BreakpointLow, _BreakpointHigh; */
/* uniform uint _BreakpointLowClock, _BreakpointHighClock; */
/* uniform uint _CheckCSR; //, _CheckMEM, _CheckMEMraw; */
/* static uint _Breakpoint, _BreakpointClock; */
Texture2D<float4> _Data_DTB_R;
Texture2D<float4> _Data_DTB_G;
Texture2D<float4> _Data_DTB_B;
Texture2D<float4> _Data_DTB_A;
#define STATE_TEX _SelfTexture2D
static uint2 s_dim;
#include "helpers.cginc"
#include "src/types.h"
#include "src/ins.h"
#include "src/uart.h"
#include "src/emu.h" // includes mmu.h, csr.h, mem.h, trap.h
#include "src/cpu.h"
uint4 frag(v2f_customrendertexture i) : SV_Target {
STATE_TEX.GetDimensions(s_dim.x, s_dim.y);
uint2 pos = i.globalTexcoord.xy * s_dim;
_Ticks /= max(_TicksDivisor, 1);
_Ticks = max(_Ticks, 2);
/* _Breakpoint = _BreakpointLow | (_BreakpointHigh << 16); */
/* _BreakpointClock = _BreakpointLowClock | (_BreakpointHighClock << 16); */
if (_Init) {
if (!_InitRaw) {
cpu = cpu_init();
}
} else {
if (!pixel_has_state(pos)) {
return STATE_TEX[pos];
}
decode(_UdonUARTPtr);
[fastopt]
for (uint i = 0; i < _Ticks && !cpu.stall; i++) {
cpu_tick();
}
}
/* cpu.debug_csr_val = read_csr_raw(_CheckCSR); */
/* cpu.debug_mem_val = mem_get_word(_CheckMEM | (_CheckMEMraw ? 0 : 0x80000000)); */
return encode(pos);
/* return uint4(mem_get_word(0x80000000), 0, 0, 0); */
/* return uint4(uint(pos.x + 128*pos.y) % 256, 0, 0, 0); */
}
ENDCG
}
Pass
{
Name "Commit"
CGPROGRAM
#pragma target 5.0
#pragma vertex CustomRenderTextureVertexShader
#pragma fragment frag
#define PASS_COMMIT
// custom crt include
#include "crt.cginc"
#include "UnityCG.cginc"
float _Init, _InitRaw;
Texture2D<float4> _Data_RAM_R;
Texture2D<float4> _Data_RAM_G;
Texture2D<float4> _Data_RAM_B;
Texture2D<float4> _Data_RAM_A;
Texture2D<uint4> _Data_RAM_RAW;
#define STATE_TEX _SelfTexture2D
static uint2 s_dim;
#include "helpers.cginc"
#include "src/types.h"
uint4 frag(v2f_customrendertexture i) : SV_Target {
STATE_TEX.GetDimensions(s_dim.x, s_dim.y);
uint2 pos = i.globalTexcoord.xy * s_dim;
if (_Init && _InitRaw) {
return _Data_RAM_RAW[pos];
}
decode_for_commit();
return commit(pos);
}
ENDCG
}
}
}

9
_Nix/rvc/main.shader.meta Executable file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6ee21bb85e36aaa439fa6f9c31141333
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

8
_Nix/rvc/src.meta Executable file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9d0773faab281b541af9270c0e5d7008
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

49
_Nix/rvc/src/cpu.h Executable file
View File

@ -0,0 +1,49 @@
#ifndef CPU_H
#define CPU_H
cpu_t cpu_init() {
cpu_t ret = (cpu_t)0;
ret.xreg11 = 0x1020; // linux? device tree?
ret.pc = 0x80000000;
ret.reservation_en = false;
ret.uart.rbr_thr_ier_iir = 0x00000000;
ret.uart.lcr_mcr_lsr_scr = 0x00200000; // LSR_THR_EMPTY is set
ret.csr.privilege = 3; // PRIV_MACHINE
return ret;
}
void cpu_tick() {
// DEBUG: single stepping
if (_DoTick && _DoTick == cpu.debug_do_tick) {
return;
}
cpu.debug_do_tick = _DoTick;
/* cpu.debug_arb_0 = */
/* cpu.debug_arb_1 = */
/* cpu.debug_arb_2 = */
/* cpu.debug_arb_3 = */
/* cpu.debug_arb_4 = */
/* cpu.debug_arb_5 = */
/* cpu.debug_arb_6 = */
/* cpu.debug_arb_7 = 0; */
cpu.clock++;
emulate();
/* if ((_BreakpointClock && _BreakpointClock == cpu.clock) || (_Breakpoint && _Breakpoint == cpu.pc)) { */
/* cpu.debug_do_tick = 0xffffffff; */
/* _DoTick = cpu.debug_do_tick; */
/* } */
if (cpu.stall) {
cpu.stall_count++;
return;
}
}
#endif

95
_Nix/rvc/src/cpu.h.meta Executable file
View File

@ -0,0 +1,95 @@
fileFormatVersion: 2
guid: a4e6e621af577d74b9555b1025599b09
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings: {}
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

197
_Nix/rvc/src/csr.h Executable file
View File

@ -0,0 +1,197 @@
#ifndef CSR_H
#define CSR_H
/* must match set/line count above, shift by two to ignore byte offset */
#define RAM_L1_TAG(a) ((a >> 2) & 0xf)
#define CSR_USTATUS 0x000
#define CSR_UIE 0x004
#define CSR_UTVEC 0x005
#define _CSR_USCRATCH 0x040
#define CSR_UEPC 0x041
#define CSR_UCAUSE 0x042
#define CSR_UTVAL 0x043
#define _CSR_UIP 0x044
#define CSR_SSTATUS 0x100
#define CSR_SEDELEG 0x102
#define CSR_SIDELEG 0x103
#define CSR_SIE 0x104
#define CSR_STVEC 0x105
#define _CSR_SSCRATCH 0x140
#define CSR_SEPC 0x141
#define CSR_SCAUSE 0x142
#define CSR_STVAL 0x143
#define CSR_SIP 0x144
#define CSR_SATP 0x180
#define CSR_MSTATUS 0x300
#define CSR_MISA 0x301
#define CSR_MEDELEG 0x302
#define CSR_MIDELEG 0x303
#define CSR_MIE 0x304
#define CSR_MTVEC 0x305
#define _CSR_MSCRATCH 0x340
#define CSR_MEPC 0x341
#define CSR_MCAUSE 0x342
#define CSR_MTVAL 0x343
#define CSR_MIP 0x344
#define _CSR_PMPCFG0 0x3a0
#define _CSR_PMPADDR0 0x3b0
#define CSR_MCYCLE 0xb00
#define CSR_CYCLE 0xc00
#define CSR_TIME 0xc01
#define _CSR_INSERT 0xc02
#define CSR_MHARTID 0xf14
#define CSR_MEMOP_OP 0x0b0
#define CSR_MEMOP_SRC 0x0b1
#define CSR_MEMOP_DST 0x0b2
#define CSR_MEMOP_N 0x0b3
bool has_csr_access_privilege(uint addr) {
uint privilege = (addr >> 8) & 0x3;
return privilege <= cpu.csr.privilege;
}
// SSTATUS, SIE, and SIP are subsets of MSTATUS, MIE, and MIP
uint read_csr_raw(uint address) {
address &= 0x1fff;
uint read_mask = 0xffffffff;
[branch]
switch (address) {
case CSR_MISA: return 0x40141101; // 0b01000000000101000001000100000001 = RV32AIMSU
case CSR_SSTATUS: address = CSR_MSTATUS; read_mask = 0x000de162; break;
case CSR_SIE: address = CSR_MIE; read_mask = 0x222; break;
case CSR_SIP: address = CSR_MIP; read_mask = 0x222; break;
case CSR_TIME: return cpu.clint.mtime_lo;
case CSR_MCYCLE: return cpu.clock;
case CSR_CYCLE: return cpu.clock;
case CSR_MHARTID: return 0;
case CSR_SATP: return (cpu.mmu.mode << 31) | cpu.mmu.ppn;
}
uint ret;
if (false) {}
else if (cpu.cache.csr_cache_0_addr == address) { ret = cpu.cache.csr_cache_0_val; }
else if (cpu.cache.csr_cache_1_addr == address) { ret = cpu.cache.csr_cache_1_val; }
else if (cpu.cache.csr_cache_2_addr == address) { ret = cpu.cache.csr_cache_2_val; }
else if (cpu.cache.csr_cache_3_addr == address) { ret = cpu.cache.csr_cache_3_val; }
else if (cpu.cache.csr_cache_4_addr == address) { ret = cpu.cache.csr_cache_4_val; }
else if (cpu.cache.csr_cache_5_addr == address) { ret = cpu.cache.csr_cache_5_val; }
else if (cpu.cache.csr_cache_6_addr == address) { ret = cpu.cache.csr_cache_6_val; }
else if (cpu.cache.csr_cache_7_addr == address) { ret = cpu.cache.csr_cache_7_val; }
else if (cpu.cache.csr_cache_8_addr == address) { ret = cpu.cache.csr_cache_8_val; }
else if (cpu.cache.csr_cache_9_addr == address) { ret = cpu.cache.csr_cache_9_val; }
else if (cpu.cache.csr_cache_10_addr == address) { ret = cpu.cache.csr_cache_10_val; }
else if (cpu.cache.csr_cache_11_addr == address) { ret = cpu.cache.csr_cache_11_val; }
else if (cpu.cache.csr_cache_12_addr == address) { ret = cpu.cache.csr_cache_12_val; }
else if (cpu.cache.csr_cache_13_addr == address) { ret = cpu.cache.csr_cache_13_val; }
else if (cpu.cache.csr_cache_14_addr == address) { ret = cpu.cache.csr_cache_14_val; }
else if (cpu.cache.csr_cache_15_addr == address) { ret = cpu.cache.csr_cache_15_val; }
else {
// fallback, read value from CSR texture area
ret = tex_get_csr(address);
}
return ret & read_mask;
}
void write_csr_raw(uint address, uint value) {
uint where = address & 0x1fff;
uint what = value;
uint modify_mask = 0;
ins_ret nop = ins_ret_noop();
[branch]
switch (address) {
case CSR_SSTATUS:
where = CSR_MSTATUS;
modify_mask = 0x000de162;
break;
case CSR_SIE:
where = CSR_MIE;
modify_mask = 0x222;
break;
case CSR_SIP:
where = CSR_MIP;
modify_mask = 0x222;
break;
case CSR_MIDELEG:
what &= 0x666; // from qemu
break;
case CSR_MEMOP_SRC:
cpu.memop_src_v = what;
return;
case CSR_MEMOP_DST:
cpu.memop_dst_v = what;
return;
case CSR_MEMOP_N:
cpu.memop_n = what;
return;
case CSR_MEMOP_OP:
cpu.stall = STALL_MEMOP_COPY;
return;
};
if (modify_mask) {
what = (read_csr_raw(where) & ~modify_mask) | (value & modify_mask);
}
if (false) {}
else if (cpu.cache.csr_cache_0_addr == 0xffffffff || cpu.cache.csr_cache_0_addr == where) { cpu.cache.csr_cache_0_addr = where; cpu.cache.csr_cache_0_val = what; return; }
else if (cpu.cache.csr_cache_1_addr == 0xffffffff || cpu.cache.csr_cache_1_addr == where) { cpu.cache.csr_cache_1_addr = where; cpu.cache.csr_cache_1_val = what; return; }
else if (cpu.cache.csr_cache_2_addr == 0xffffffff || cpu.cache.csr_cache_2_addr == where) { cpu.cache.csr_cache_2_addr = where; cpu.cache.csr_cache_2_val = what; return; }
else if (cpu.cache.csr_cache_3_addr == 0xffffffff || cpu.cache.csr_cache_3_addr == where) { cpu.cache.csr_cache_3_addr = where; cpu.cache.csr_cache_3_val = what; return; }
else if (cpu.cache.csr_cache_4_addr == 0xffffffff || cpu.cache.csr_cache_4_addr == where) { cpu.cache.csr_cache_4_addr = where; cpu.cache.csr_cache_4_val = what; return; }
else if (cpu.cache.csr_cache_5_addr == 0xffffffff || cpu.cache.csr_cache_5_addr == where) { cpu.cache.csr_cache_5_addr = where; cpu.cache.csr_cache_5_val = what; return; }
else if (cpu.cache.csr_cache_6_addr == 0xffffffff || cpu.cache.csr_cache_6_addr == where) { cpu.cache.csr_cache_6_addr = where; cpu.cache.csr_cache_6_val = what; return; }
else if (cpu.cache.csr_cache_7_addr == 0xffffffff || cpu.cache.csr_cache_7_addr == where) { cpu.cache.csr_cache_7_addr = where; cpu.cache.csr_cache_7_val = what; return; }
else if (cpu.cache.csr_cache_8_addr == 0xffffffff || cpu.cache.csr_cache_8_addr == where) { cpu.cache.csr_cache_8_addr = where; cpu.cache.csr_cache_8_val = what; return; }
else if (cpu.cache.csr_cache_9_addr == 0xffffffff || cpu.cache.csr_cache_9_addr == where) { cpu.cache.csr_cache_9_addr = where; cpu.cache.csr_cache_9_val = what; return; }
else if (cpu.cache.csr_cache_10_addr == 0xffffffff || cpu.cache.csr_cache_10_addr == where) { cpu.cache.csr_cache_10_addr = where; cpu.cache.csr_cache_10_val = what; return; }
else if (cpu.cache.csr_cache_11_addr == 0xffffffff || cpu.cache.csr_cache_11_addr == where) { cpu.cache.csr_cache_11_addr = where; cpu.cache.csr_cache_11_val = what; return; }
else if (cpu.cache.csr_cache_12_addr == 0xffffffff || cpu.cache.csr_cache_12_addr == where) { cpu.cache.csr_cache_12_addr = where; cpu.cache.csr_cache_12_val = what; return; }
else if (cpu.cache.csr_cache_13_addr == 0xffffffff || cpu.cache.csr_cache_13_addr == where) { cpu.cache.csr_cache_13_addr = where; cpu.cache.csr_cache_13_val = what; return; }
else if (cpu.cache.csr_cache_14_addr == 0xffffffff || cpu.cache.csr_cache_14_addr == where) { cpu.cache.csr_cache_14_addr = where; cpu.cache.csr_cache_14_val = what; return; }
// cache overflow, stall to avoid fillup
cpu.cache.csr_cache_15_addr = where;
cpu.cache.csr_cache_15_val = what;
cpu.stall = STALL_CSR_CACHE;
}
uint get_csr(uint address, inout ins_ret ret) {
if (has_csr_access_privilege(address)) {
uint r = read_csr_raw(address);
return r;
} else {
ret.trap.en = true;
ret.trap.type = trap_IllegalInstruction;
ret.trap.value = cpu.pc;
return 0;
}
}
void set_csr(uint address, uint value, inout ins_ret ret) {
bool read_only = ((address >> 10) & 0x3) == 0x3;
if (has_csr_access_privilege(address) && !read_only) {
if (address == CSR_SATP) {
mmu_update(value);
return;
}
write_csr_raw(address, value);
} else {
ret.trap.en = true;
ret.trap.type = trap_IllegalInstruction;
ret.trap.value = cpu.pc;
}
}
#endif

27
_Nix/rvc/src/csr.h.meta Executable file
View File

@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: d1647512864dd72488b5ea192795f284
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

170
_Nix/rvc/src/csr.h.pp Executable file
View File

@ -0,0 +1,170 @@
#ifndef CSR_H
#define CSR_H
<?:include header.p ?>
#define CSR_USTATUS 0x000
#define CSR_UIE 0x004
#define CSR_UTVEC 0x005
#define _CSR_USCRATCH 0x040
#define CSR_UEPC 0x041
#define CSR_UCAUSE 0x042
#define CSR_UTVAL 0x043
#define _CSR_UIP 0x044
#define CSR_SSTATUS 0x100
#define CSR_SEDELEG 0x102
#define CSR_SIDELEG 0x103
#define CSR_SIE 0x104
#define CSR_STVEC 0x105
#define _CSR_SSCRATCH 0x140
#define CSR_SEPC 0x141
#define CSR_SCAUSE 0x142
#define CSR_STVAL 0x143
#define CSR_SIP 0x144
#define CSR_SATP 0x180
#define CSR_MSTATUS 0x300
#define CSR_MISA 0x301
#define CSR_MEDELEG 0x302
#define CSR_MIDELEG 0x303
#define CSR_MIE 0x304
#define CSR_MTVEC 0x305
#define _CSR_MSCRATCH 0x340
#define CSR_MEPC 0x341
#define CSR_MCAUSE 0x342
#define CSR_MTVAL 0x343
#define CSR_MIP 0x344
#define _CSR_PMPCFG0 0x3a0
#define _CSR_PMPADDR0 0x3b0
#define CSR_MCYCLE 0xb00
#define CSR_CYCLE 0xc00
#define CSR_TIME 0xc01
#define _CSR_INSERT 0xc02
#define CSR_MHARTID 0xf14
#define CSR_MEMOP_OP 0x0b0
#define CSR_MEMOP_SRC 0x0b1
#define CSR_MEMOP_DST 0x0b2
#define CSR_MEMOP_N 0x0b3
bool has_csr_access_privilege(uint addr) {
uint privilege = (addr >> 8) & 0x3;
return privilege <= cpu.csr.privilege;
}
// SSTATUS, SIE, and SIP are subsets of MSTATUS, MIE, and MIP
uint read_csr_raw(uint address) {
address &= 0x1fff;
uint read_mask = 0xffffffff;
[branch]
switch (address) {
case CSR_MISA: return 0x40141101; // 0b01000000000101000001000100000001 = RV32AIMSU
case CSR_SSTATUS: address = CSR_MSTATUS; read_mask = 0x000de162; break;
case CSR_SIE: address = CSR_MIE; read_mask = 0x222; break;
case CSR_SIP: address = CSR_MIP; read_mask = 0x222; break;
case CSR_TIME: return cpu.clint.mtime_lo;
case CSR_MCYCLE: return cpu.clock;
case CSR_CYCLE: return cpu.clock;
case CSR_MHARTID: return 0;
case CSR_SATP: return (cpu.mmu.mode << 31) | cpu.mmu.ppn;
}
uint ret;
if (false) {}
<?
for my $i (0..$csr_cache_max) {
print "else if (cpu.cache.csr_cache_${i}_addr == address) { ret = cpu.cache.csr_cache_${i}_val; }\n";
}
?>
else {
// fallback, read value from CSR texture area
ret = tex_get_csr(address);
}
return ret & read_mask;
}
void write_csr_raw(uint address, uint value) {
uint where = address & 0x1fff;
uint what = value;
uint modify_mask = 0;
ins_ret nop = ins_ret_noop();
[branch]
switch (address) {
case CSR_SSTATUS:
where = CSR_MSTATUS;
modify_mask = 0x000de162;
break;
case CSR_SIE:
where = CSR_MIE;
modify_mask = 0x222;
break;
case CSR_SIP:
where = CSR_MIP;
modify_mask = 0x222;
break;
case CSR_MIDELEG:
what &= 0x666; // from qemu
break;
case CSR_MEMOP_SRC:
cpu.memop_src_v = what;
return;
case CSR_MEMOP_DST:
cpu.memop_dst_v = what;
return;
case CSR_MEMOP_N:
cpu.memop_n = what;
return;
case CSR_MEMOP_OP:
cpu.stall = STALL_MEMOP_COPY;
return;
};
if (modify_mask) {
what = (read_csr_raw(where) & ~modify_mask) | (value & modify_mask);
}
if (false) {}
<?
for my $i (0..($csr_cache_max - 1)) {
print "else if (cpu.cache.csr_cache_${i}_addr == 0xffffffff || cpu.cache.csr_cache_${i}_addr == where) { cpu.cache.csr_cache_${i}_addr = where; cpu.cache.csr_cache_${i}_val = what; return; }\n";
}
?>
// cache overflow, stall to avoid fillup
cpu.cache.csr_cache_<?= $csr_cache_max ?>_addr = where;
cpu.cache.csr_cache_<?= $csr_cache_max ?>_val = what;
cpu.stall = STALL_CSR_CACHE;
}
uint get_csr(uint address, inout ins_ret ret) {
if (has_csr_access_privilege(address)) {
uint r = read_csr_raw(address);
return r;
} else {
ret.trap.en = true;
ret.trap.type = trap_IllegalInstruction;
ret.trap.value = cpu.pc;
return 0;
}
}
void set_csr(uint address, uint value, inout ins_ret ret) {
bool read_only = ((address >> 10) & 0x3) == 0x3;
if (has_csr_access_privilege(address) && !read_only) {
if (address == CSR_SATP) {
mmu_update(value);
return;
}
write_csr_raw(address, value);
} else {
ret.trap.en = true;
ret.trap.type = trap_IllegalInstruction;
ret.trap.value = cpu.pc;
}
}
#endif

7
_Nix/rvc/src/csr.h.pp.meta Executable file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b91567c90da19ff419c6b2718558ab3c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

703
_Nix/rvc/src/emu.h Executable file
View File

@ -0,0 +1,703 @@
#ifndef EMU_H
#define EMU_H
#include "mmu.h"
#define AS_SIGNED(val) (asint(val))
#define AS_UNSIGNED(val) (asuint(val))
// this is just a leftover from C, where AS_SIGNED/AS_UNSIGNED needed this as consts
// please don't judge me
#define ZERO 0
#define ONE 1
#define DEF(name, fmt_t, code) \
void emu_##name(uint ins_word, inout ins_ret ret, fmt_t ins) { code }
#define WR_RD(code) { ret.write_reg = ins.rd; ret.write_val = AS_UNSIGNED(code); }
#define WR_PC(code) { ret.pc_val = AS_UNSIGNED(code); }
#define WR_CSR(code) { ret.csr_write = ins.csr; ret.csr_val = AS_UNSIGNED(code); }
#define WR_MEM(addr, code, size) { ret.mem_wr_addr = addr; ret.mem_wr_size = size; ret.mem_wr_value = AS_UNSIGNED(code); }
/*
* BEGIN INSTRUCTIONS
*/
static uint prepared_mem_val;
DEF(add, FormatR, { // rv32i
WR_RD(AS_SIGNED(xreg(ins.rs1)) + AS_SIGNED(xreg(ins.rs2)));
})
DEF(addi, FormatI, { // rv32i
WR_RD(AS_SIGNED(xreg(ins.rs1)) + AS_SIGNED(ins.imm));
})
DEF(amoswap_w, FormatR, { // rv32a
uint tmp = prepared_mem_val;
WR_MEM(xreg(ins.rs1), (xreg(ins.rs2)), 32)
WR_RD(tmp)
})
DEF(amoadd_w, FormatR, { // rv32a
WR_MEM(xreg(ins.rs1), (xreg(ins.rs2) + prepared_mem_val), 32)
WR_RD(prepared_mem_val)
})
DEF(amoxor_w, FormatR, { // rv32a
WR_MEM(xreg(ins.rs1), (xreg(ins.rs2) ^ prepared_mem_val), 32)
WR_RD(prepared_mem_val)
})
DEF(amoand_w, FormatR, { // rv32a
WR_MEM(xreg(ins.rs1), (xreg(ins.rs2) & prepared_mem_val), 32)
WR_RD(prepared_mem_val)
})
DEF(amoor_w, FormatR, { // rv32a
WR_MEM(xreg(ins.rs1), (xreg(ins.rs2) | prepared_mem_val), 32)
WR_RD(prepared_mem_val)
})
DEF(amomin_w, FormatR, { // rv32a
uint sec = xreg(ins.rs2);
WR_MEM(xreg(ins.rs1), (AS_SIGNED(sec) < AS_SIGNED(prepared_mem_val) ? sec : prepared_mem_val), 32)
WR_RD(prepared_mem_val)
})
DEF(amomax_w, FormatR, { // rv32a
uint sec = xreg(ins.rs2);
WR_MEM(xreg(ins.rs1), (AS_SIGNED(sec) > AS_SIGNED(prepared_mem_val) ? sec : prepared_mem_val), 32)
WR_RD(prepared_mem_val)
})
DEF(amominu_w, FormatR, { // rv32a
uint sec = xreg(ins.rs2);
WR_MEM(xreg(ins.rs1), (AS_UNSIGNED(sec) < AS_UNSIGNED(prepared_mem_val) ? sec : prepared_mem_val), 32)
WR_RD(prepared_mem_val)
})
DEF(amomaxu_w, FormatR, { // rv32a
uint sec = xreg(ins.rs2);
WR_MEM(xreg(ins.rs1), (AS_UNSIGNED(sec) > AS_UNSIGNED(prepared_mem_val) ? sec : prepared_mem_val), 32)
WR_RD(prepared_mem_val)
})
DEF(and, FormatR, { // rv32i
WR_RD(xreg(ins.rs1) & xreg(ins.rs2))
})
DEF(andi, FormatI, { // rv32i
WR_RD(xreg(ins.rs1) & ins.imm)
})
DEF(auipc, FormatU, { // rv32i
WR_RD(cpu.pc + ins.imm)
})
DEF(beq, FormatB, { // rv32i
if (xreg(ins.rs1) == xreg(ins.rs2)) {
WR_PC(cpu.pc + ins.imm);
}
})
DEF(bge, FormatB, { // rv32i
if (AS_SIGNED(xreg(ins.rs1)) >= AS_SIGNED(xreg(ins.rs2))) {
WR_PC(cpu.pc + ins.imm);
}
})
DEF(bgeu, FormatB, { // rv32i
if (AS_UNSIGNED(xreg(ins.rs1)) >= AS_UNSIGNED(xreg(ins.rs2))) {
WR_PC(cpu.pc + ins.imm);
}
})
DEF(blt, FormatB, { // rv32i
if (AS_SIGNED(xreg(ins.rs1)) < AS_SIGNED(xreg(ins.rs2))) {
WR_PC(cpu.pc + ins.imm);
}
})
DEF(bltu, FormatB, { // rv32i
if (AS_UNSIGNED(xreg(ins.rs1)) < AS_UNSIGNED(xreg(ins.rs2))) {
WR_PC(cpu.pc + ins.imm);
}
})
DEF(bne, FormatB, { // rv32i
if (xreg(ins.rs1) != xreg(ins.rs2)) {
WR_PC(cpu.pc + ins.imm);
}
})
DEF(csrrc, FormatCSR, { // system
uint rs = xreg(ins.rs);
if (rs != 0) {
WR_CSR(ins.value & ~rs);
}
WR_RD(ins.value)
})
DEF(csrrci, FormatCSR, { // system
if (ins.rs != 0) {
WR_CSR(ins.value & (~ins.rs));
}
WR_RD(ins.value)
})
DEF(csrrs, FormatCSR, { // system
uint rs = xreg(ins.rs);
if (rs != 0) {
WR_CSR(ins.value | rs);
}
WR_RD(ins.value)
})
DEF(csrrsi, FormatCSR, { // system
if (ins.rs != 0) {
WR_CSR(ins.value | ins.rs);
}
WR_RD(ins.value)
})
DEF(csrrw, FormatCSR, { // system
WR_CSR(xreg(ins.rs));
WR_RD(ins.value)
})
DEF(csrrwi, FormatCSR, { // system
WR_CSR(ins.rs);
WR_RD(ins.value)
})
DEF(div, FormatR, { // rv32m
uint dividend = xreg(ins.rs1);
uint divisor = xreg(ins.rs2);
uint result;
if (divisor == 0) {
result = 0xFFFFFFFF;
} else if (dividend == 0x80000000 && divisor == 0xFFFFFFFF) {
result = dividend;
} else {
int tmp = AS_SIGNED(dividend) / AS_SIGNED(divisor);
result = AS_UNSIGNED(tmp);
}
WR_RD(result)
})
DEF(divu, FormatR, { // rv32m
uint dividend = xreg(ins.rs1);
uint divisor = xreg(ins.rs2);
uint result;
if (divisor == 0) {
result = 0xFFFFFFFF;
} else {
result = dividend / divisor;
}
WR_RD(result)
})
DEF(ebreak, FormatEmpty, { // system
// unnecessary?
})
DEF(ecall, FormatEmpty, { // system
/* if (xreg(17) == 93) { */
/* // EXIT CALL - only used for self-tests */
/* uint status = xreg(10); */
/* cpu.stall = STALL_EXIT_CALL; */
/* write_csr_raw(0x200, status); */
/* } else { */
ret.trap.en = true;
ret.trap.value = cpu.pc;
if (cpu.csr.privilege == PRIV_USER) {
ret.trap.type = trap_EnvironmentCallFromUMode;
} else if (cpu.csr.privilege == PRIV_SUPERVISOR) {
ret.trap.type = trap_EnvironmentCallFromSMode;
} else { // PRIV_MACHINE
ret.trap.type = trap_EnvironmentCallFromMMode;
}
/* } */
})
DEF(fence, FormatEmpty, { // rv32i
// skip
})
DEF(fence_i, FormatEmpty, { // rv32i
cpu.stall = STALL_FENCE;
})
DEF(jal, FormatJ, { // rv32i
WR_RD(cpu.pc + 4);
WR_PC(cpu.pc + ins.imm);
})
DEF(jalr, FormatI, { // rv32i
WR_RD(cpu.pc + 4);
WR_PC(xreg(ins.rs1) + ins.imm);
})
DEF(lb, FormatI, { // rv32i
uint tmp = sign_extend(prepared_mem_val & 0xff, 8);
WR_RD(tmp)
})
DEF(lbu, FormatI, { // rv32i
uint tmp = prepared_mem_val & 0xff;
WR_RD(tmp)
})
DEF(lh, FormatI, { // rv32i
uint tmp = sign_extend(prepared_mem_val & 0xffff, 16);
WR_RD(tmp)
})
DEF(lhu, FormatI, { // rv32i
uint tmp = prepared_mem_val & 0xffff;
WR_RD(tmp)
})
DEF(lr_w, FormatR, { // rv32a
uint addr = xreg(ins.rs1);
uint tmp = prepared_mem_val;
cpu.reservation_en = true;
cpu.reservation_addr = addr;
WR_RD(tmp)
})
DEF(lui, FormatU, { // rv32i
WR_RD(ins.imm)
})
DEF(lw, FormatI, { // rv32i
// would need sign extend for xlen > 32
WR_RD(prepared_mem_val)
})
DEF(mret, FormatEmpty, { // system
uint newpc = get_csr(CSR_MEPC, ret);
if (!ret.trap.en) {
uint status = read_csr_raw(CSR_MSTATUS);
uint mpie = (status >> 7) & 1;
uint mpp = (status >> 11) & 0x3;
uint mprv = mpp == PRIV_MACHINE ? ((status >> 17) & 1) : 0;
uint new_status = (status & ~0x21888) | (mprv << 17) | (mpie << 3) | (1 << 7);
write_csr_raw(CSR_MSTATUS, new_status);
cpu.csr.privilege = mpp;
WR_PC(newpc)
}
})
DEF(mul, FormatR, { // rv32m
uint tmp = AS_SIGNED(xreg(ins.rs1)) * AS_SIGNED(xreg(ins.rs2));
WR_RD(tmp)
})
DEF(mulh, FormatR, { // rv32m
// FIXME: mulh-family instructions have to use double precision floating points internally atm...
// umul/imul (https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/umul--sm4---asm-)
// do exist, but appear to be unusable?
precise double op1 = AS_SIGNED(xreg(ins.rs1));
precise double op2 = AS_SIGNED(xreg(ins.rs2));
uint tmp = uint((op1 * op2) / 4294967296.0l); // '/ 4294967296' == '>> 32'
WR_RD(tmp)
})
DEF(mulhsu, FormatR, { // rv32m
// is the signed/unsigned stuff even correct? who knows...
precise double op1 = AS_SIGNED(xreg(ins.rs1));
precise double op2 = AS_UNSIGNED(xreg(ins.rs2));
uint tmp = uint((op1 * op2) / 4294967296.0l); // '/ 4294967296' == '>> 32'
WR_RD(tmp)
})
DEF(mulhu, FormatR, { // rv32m
precise double op1 = AS_UNSIGNED(xreg(ins.rs1));
precise double op2 = AS_UNSIGNED(xreg(ins.rs2));
uint tmp = uint((op1 * op2) / 4294967296.0l); // '/ 4294967296' == '>> 32'
WR_RD(tmp)
})
DEF(or, FormatR, { // rv32i
WR_RD(xreg(ins.rs1) | xreg(ins.rs2))
})
DEF(ori, FormatI, { // rv32i
WR_RD(xreg(ins.rs1) | ins.imm)
})
DEF(rem, FormatR, { // rv32m
uint dividend = xreg(ins.rs1);
uint divisor = xreg(ins.rs2);
uint result;
if (divisor == 0) {
result = dividend;
} else if (dividend == 0x80000000 && divisor == 0xFFFFFFFF) {
result = 0;
} else {
int tmp = AS_SIGNED(dividend) % AS_SIGNED(divisor);
result = AS_UNSIGNED(tmp);
}
WR_RD(result)
})
DEF(remu, FormatR, { // rv32m
uint dividend = xreg(ins.rs1);
uint divisor = xreg(ins.rs2);
uint result;
if (divisor == 0) {
result = dividend;
} else {
result = dividend % divisor;
}
WR_RD(result)
})
DEF(sb, FormatS, { // rv32i
WR_MEM(ins.addr, xreg(ins.rs2), 8)
})
DEF(sc_w, FormatR, { // rv32a
// I'm pretty sure this is not it chief, but it does the trick for now
uint addr = xreg(ins.rs1);
if (cpu.reservation_en && cpu.reservation_addr == addr) {
WR_MEM(addr, xreg(ins.rs2), 32);
cpu.reservation_en = false;
WR_RD(ZERO)
} else {
WR_RD(ONE)
}
})
DEF(sfence_vma, FormatEmpty, { // system
/* cpu.stall = STALL_FENCE; */
})
DEF(sh, FormatS, { // rv32i
WR_MEM(ins.addr, xreg(ins.rs2), 16)
})
DEF(sll, FormatR, { // rv32i
WR_RD(xreg(ins.rs1) << xreg(ins.rs2))
})
DEF(slli, FormatR, { // rv32i
uint shamt = (ins_word >> 20) & 0x1F;
WR_RD(xreg(ins.rs1) << shamt)
})
DEF(slt, FormatR, { // rv32i
if (AS_SIGNED(xreg(ins.rs1)) < AS_SIGNED(xreg(ins.rs2))) {
WR_RD(ONE)
} else {
WR_RD(ZERO)
}
})
DEF(slti, FormatI, { // rv32i
if (AS_SIGNED(xreg(ins.rs1)) < AS_SIGNED(ins.imm)) {
WR_RD(ONE)
} else {
WR_RD(ZERO)
}
})
DEF(sltiu, FormatI, { // rv32i
if (AS_UNSIGNED(xreg(ins.rs1)) < AS_UNSIGNED(ins.imm)) {
WR_RD(ONE)
} else {
WR_RD(ZERO)
}
})
DEF(sltu, FormatR, { // rv32i
if (AS_UNSIGNED(xreg(ins.rs1)) < AS_UNSIGNED(xreg(ins.rs2))) {
WR_RD(ONE)
} else {
WR_RD(ZERO)
}
})
DEF(sra, FormatR, { // rv32i
uint msr = xreg(ins.rs1) & 0x80000000;
WR_RD(msr ? ~(~xreg(ins.rs1) >> xreg(ins.rs2)) :
xreg(ins.rs1) >> xreg(ins.rs2))
})
DEF(srai, FormatR, { // rv32i
uint msr = xreg(ins.rs1) & 0x80000000;
uint shamt = (ins_word >> 20) & 0x1F;
WR_RD(msr ? ~(~xreg(ins.rs1) >> shamt) :
xreg(ins.rs1) >> shamt)
})
DEF(sret, FormatEmpty, { // system
uint newpc = get_csr(CSR_SEPC, ret);
if (!ret.trap.en) {
uint status = read_csr_raw(CSR_SSTATUS);
uint spie = (status >> 5) & 1;
uint spp = (status >> 8) & 1;
uint mprv = spp == PRIV_MACHINE ? ((status >> 17) & 1) : 0;
uint new_status = (status & ~0x20122) | (mprv << 17) | (spie << 1) | (1 << 5);
write_csr_raw(CSR_SSTATUS, new_status);
cpu.csr.privilege = spp;
WR_PC(newpc)
}
})
DEF(srl, FormatR, { // rv32i
WR_RD(xreg(ins.rs1) >> xreg(ins.rs2))
})
DEF(srli, FormatR, { // rv32i
uint shamt = (ins_word >> 20) & 0x1F;
WR_RD(xreg(ins.rs1) >> shamt)
})
DEF(sub, FormatR, { // rv32i
WR_RD(AS_SIGNED(xreg(ins.rs1)) - AS_SIGNED(xreg(ins.rs2)));
})
DEF(sw, FormatS, { // rv32i
WR_MEM(ins.addr, xreg(ins.rs2), 32)
})
DEF(uret, FormatEmpty, { // system
// unnecessary?
})
DEF(wfi, FormatEmpty, { // system
// no-op is valid here, so skip
})
DEF(xor, FormatR, { // rv32i
WR_RD(xreg(ins.rs1) ^ xreg(ins.rs2))
})
DEF(xori, FormatI, { // rv32i
WR_RD(xreg(ins.rs1) ^ ins.imm)
})
/*
* END INSTRUCTIONS
*/
#define RUN(name, data, insf) case data : { \
emu_##name(ins_word, ret, insf); \
return ret; \
}
ins_ret ins_select(uint ins_word, inout ins_ret ret) {
uint ins_masked;
FormatEmpty ins_FormatEmpty = parse_FormatEmpty(ins_word);
FormatCSR ins_FormatCSR = parse_FormatCSR(ins_word);
FormatI ins_FormatI = parse_FormatI(ins_word);
FormatU ins_FormatU = parse_FormatU(ins_word);
/*
NOTE: The switch statements below can't all use [forcecase].
While this would be best for performance (according to my testing),
it breaks compilation very badly, so only do it for the bigger ones.
*/
ins_masked = ins_word & 0x0000007f;
[branch]
switch (ins_masked) {
RUN(auipc, 0x00000017, ins_FormatU)
RUN(jal, 0x0000006f, parse_FormatJ(ins_word))
RUN(lui, 0x00000037, ins_FormatU)
}
FormatR ins_FormatR = parse_FormatR(ins_word);
ins_masked = ins_word & 0xfe00707f;
[forcecase]
switch (ins_masked) {
RUN(add, 0x00000033, ins_FormatR)
RUN(and, 0x00007033, ins_FormatR)
RUN(div, 0x02004033, ins_FormatR)
RUN(divu, 0x02005033, ins_FormatR)
RUN(mul, 0x02000033, ins_FormatR)
RUN(mulh, 0x02001033, ins_FormatR)
RUN(mulhsu, 0x02002033, ins_FormatR)
RUN(mulhu, 0x02003033, ins_FormatR)
RUN(or, 0x00006033, ins_FormatR)
RUN(rem, 0x02006033, ins_FormatR)
RUN(remu, 0x02007033, ins_FormatR)
RUN(sll, 0x00001033, ins_FormatR)
RUN(slt, 0x00002033, ins_FormatR)
RUN(sltu, 0x00003033, ins_FormatR)
RUN(sra, 0x40005033, ins_FormatR)
RUN(srl, 0x00005033, ins_FormatR)
RUN(sub, 0x40000033, ins_FormatR)
RUN(xor, 0x00004033, ins_FormatR)
}
FormatS ins_FormatS = parse_FormatS(ins_word);
FormatB ins_FormatB = parse_FormatB(ins_word);
// since function calls are all inlined we perform memory accesses
// all together, this way mem_get_word only has to exist once
// (though this might cause some unnecessary accesses too)
uint do_mem_read = 0;
if ((ins_word & 0x0000007f) == 0x00000003) {
// lX memory read
do_mem_read = xreg(ins_FormatI.rs1) + ins_FormatI.imm;
} else if ((ins_word & 0x0000202f) == 0x0000202f) {
// atomic memory read
do_mem_read = xreg(ins_FormatR.rs1);
}
if (do_mem_read) {
/* cpu.debug_arb_3 = do_mem_read; */
uint prepared_read_addr = mmu_translate(ret, do_mem_read, MMU_ACCESS_READ);
if (ret.trap.en) {
return ret;
}
// take care of unaligned memory reads using a loop
// so mem_get_word isn't inlined twice
uint w1 = 0, w2 = 0;
[loop]
for (uint ui = 0; ui < ((prepared_read_addr & 0x3) ? 2 : 1); ui++) {
uint tmp = mem_get_word((prepared_read_addr & (~0x3)) + 0x4 * ui);
[flatten]
if (ui) { w2 = tmp; }
else { w1 = tmp; }
}
prepared_mem_val = w1 >> ((do_mem_read & 0x3) * 8);
prepared_mem_val |= w2 << ((4 - (do_mem_read & 0x3)) * 8);
/* cpu.debug_arb_4 = w1; */
/* cpu.debug_arb_5 = w2; */
/* cpu.debug_arb_6 = prepared_read_addr; */
/* cpu.debug_arb_7 = prepared_mem_val; */
}
if ((ins_word & 0x00000073) == 0x00000073) {
// could be CSR instruction
ins_FormatCSR.value = get_csr(ins_FormatCSR.csr, ret);
}
ins_masked = ins_word & 0x0000707f;
[forcecase]
switch (ins_masked) {
RUN(addi, 0x00000013, ins_FormatI)
RUN(andi, 0x00007013, ins_FormatI)
RUN(beq, 0x00000063, ins_FormatB)
RUN(bge, 0x00005063, ins_FormatB)
RUN(bgeu, 0x00007063, ins_FormatB)
RUN(blt, 0x00004063, ins_FormatB)
RUN(bltu, 0x00006063, ins_FormatB)
RUN(bne, 0x00001063, ins_FormatB)
RUN(csrrc, 0x00003073, ins_FormatCSR)
RUN(csrrci, 0x00007073, ins_FormatCSR)
RUN(csrrs, 0x00002073, ins_FormatCSR)
RUN(csrrsi, 0x00006073, ins_FormatCSR)
RUN(csrrw, 0x00001073, ins_FormatCSR)
RUN(csrrwi, 0x00005073, ins_FormatCSR)
RUN(fence, 0x0000000f, ins_FormatEmpty)
RUN(fence_i, 0x0000100f, ins_FormatEmpty)
RUN(jalr, 0x00000067, ins_FormatI)
RUN(lb, 0x00000003, ins_FormatI)
RUN(lbu, 0x00004003, ins_FormatI)
RUN(lh, 0x00001003, ins_FormatI)
RUN(lhu, 0x00005003, ins_FormatI)
RUN(lw, 0x00002003, ins_FormatI)
RUN(ori, 0x00006013, ins_FormatI)
RUN(sb, 0x00000023, ins_FormatS)
RUN(sh, 0x00001023, ins_FormatS)
RUN(slti, 0x00002013, ins_FormatI)
RUN(sltiu, 0x00003013, ins_FormatI)
RUN(sw, 0x00002023, ins_FormatS)
RUN(xori, 0x00004013, ins_FormatI)
}
ins_masked = ins_word & 0xf800707f;
[forcecase]
switch (ins_masked) {
RUN(amoswap_w, 0x0800202f, ins_FormatR)
RUN(amoadd_w, 0x0000202f, ins_FormatR)
RUN(amoxor_w, 0x2000202f, ins_FormatR)
RUN(amoand_w, 0x6000202f, ins_FormatR)
RUN(amoor_w, 0x4000202f, ins_FormatR)
RUN(amomin_w, 0x8000202f, ins_FormatR)
RUN(amomax_w, 0xa000202f, ins_FormatR)
RUN(amominu_w, 0xc000202f, ins_FormatR)
RUN(amomaxu_w, 0xe000202f, ins_FormatR)
RUN(sc_w, 0x1800202f, ins_FormatR)
}
ins_masked = ins_word & 0xf9f0707f;
[branch]
switch (ins_masked) {
RUN(lr_w, 0x1000202f, ins_FormatR)
}
ins_masked = ins_word & 0xfc00707f;
[branch]
switch (ins_masked) {
RUN(slli, 0x00001013, ins_FormatR)
RUN(srai, 0x40005013, ins_FormatR)
RUN(srli, 0x00005013, ins_FormatR)
}
ins_masked = ins_word & 0xfe007fff;
[branch]
switch (ins_masked) {
RUN(sfence_vma, 0x12000073, ins_FormatEmpty)
}
ins_masked = ins_word & 0xffffffff;
[forcecase]
switch (ins_masked) {
RUN(ebreak, 0x00100073, ins_FormatEmpty)
RUN(ecall, 0x00000073, ins_FormatEmpty)
RUN(mret, 0x30200073, ins_FormatEmpty)
RUN(sret, 0x10200073, ins_FormatEmpty)
RUN(uret, 0x00200073, ins_FormatEmpty)
RUN(wfi, 0x10500073, ins_FormatEmpty)
}
ret.trap.en = true;
ret.trap.type = trap_IllegalInstruction;
ret.trap.value = ins_word;
return ret;
}
void emulate() {
uint ins_word = 0;
ins_ret ret = ins_ret_noop();
if ((cpu.pc & 0x3) == 0) {
uint ins_addr = mmu_translate(ret, cpu.pc, MMU_ACCESS_FETCH);
if (!ret.trap.en) {
ins_word = mem_get_instruction(ins_addr);
cpu.debug_last_ins = ins_word;
ret = ins_select(ins_word, ret);
if (ret.csr_write && !ret.trap.en) {
set_csr(ret.csr_write, ret.csr_val, ret);
if (cpu.stall == STALL_MEMOP_COPY) {
[loop]
for (uint imc = 0; imc < 2; imc++) {
uint phys = mmu_translate(ret,
imc == 0 ? cpu.memop_src_v : cpu.memop_dst_v,
imc == 0 ? MMU_ACCESS_READ : MMU_ACCESS_WRITE);
if (ret.trap.en) break;
if (imc == 0) {
cpu.memop_src_p = phys;
} else {
cpu.memop_dst_p = phys;
}
}
}
}
if (ret.mem_wr_size && !ret.trap.en) {
uint write_addr = mmu_translate(ret, ret.mem_wr_addr, MMU_ACCESS_WRITE);
if (!ret.trap.en) {
mem_set(write_addr, ret.mem_wr_value, ret.mem_wr_size / 8);
}
}
if (!ret.trap.en && ret.write_reg) {
#define C(x) case x: cpu.xreg##x = ret.write_val; break;
if (ret.write_reg < 16) {
[flatten]
switch (ret.write_reg) {
C(1) C(2) C(3)
C(4) C(5) C(6) C(7)
C(8) C(9) C(10) C(11)
C(12) C(13) C(14) C(15)
}
} else {
[flatten]
switch (ret.write_reg) {
C(16) C(17) C(18) C(19)
C(20) C(21) C(22) C(23)
C(24) C(25) C(26) C(27)
C(28) C(29) C(30) C(31)
}
}
#undef C
}
}
} else {
ret.trap.en = true;
ret.trap.type = trap_InstructionAddressMisaligned;
ret.trap.value = cpu.pc;
}
// handle CLINT IRQs
uint mip_override = read_csr_raw(CSR_MIP);
if (cpu.clint.msip) {
mip_override |= MIP_MSIP;
}
cpu.clint.mtime_lo++;
cpu.clint.mtime_hi += cpu.clint.mtime_lo == 0 ? 1 : 0;
if ((cpu.clint.mtimecmp_lo != 0 || cpu.clint.mtimecmp_hi != 0) && (cpu.clint.mtime_hi > cpu.clint.mtimecmp_hi || (cpu.clint.mtime_hi == cpu.clint.mtimecmp_hi && cpu.clint.mtime_lo >= cpu.clint.mtimecmp_lo))) {
mip_override |= MIP_MTIP;
}
uart_tick();
if (cpu.uart.interrupting) {
mip_override |= MIP_SEIP;
}
/* if (ret.trap.en && cpu.clock <= 1) { */
/* cpu.stall = STALL_ILLEGAL_ENTRY_POINT; */
/* cpu.stall_count = ins_word; */
/* cpu.trap_count = cpu.pc; */
/* } */
// will write CSR_MIP if necessary
handle_irq_and_trap(ret, mip_override);
/* if (ret.pc_val & 0x3) { */
/* cpu.debug_arb_0 = ret.pc_val; */
/* cpu.debug_arb_1 = ret.trap.en; */
/* cpu.debug_arb_2 = ret.trap.type; */
/* cpu.debug_arb_3 = ret.trap.value; */
/* cpu.debug_do_tick = 0xffffffff; */
/* _DoTick = cpu.debug_do_tick; */
/* cpu.stall = STALL_FENCE; */
/* } */
// ret.pc_val should be set to pc+4 by default
cpu.pc = ret.pc_val;
}
#endif

27
_Nix/rvc/src/emu.h.meta Executable file
View File

@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: 7d6d4c997ea88674aaece642ba019c9b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

9
_Nix/rvc/src/header.p Executable file
View File

@ -0,0 +1,9 @@
<?
my $csr_cache_max = 15;
my $uart_buffer_max = 63;
my $ram_l1_set_max = 15; # sets
my $ram_l1_line_max = 4; # words per line
?>
/* must match set/line count above, shift by two to ignore byte offset */
#define RAM_L1_TAG(a) ((a >> 2) & 0xf)

7
_Nix/rvc/src/header.p.meta Executable file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ae7b6df175bef2448bd79480ac863a32
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

119
_Nix/rvc/src/ins.h Executable file
View File

@ -0,0 +1,119 @@
#ifndef INS_H
#define INS_H
typedef struct {
uint rs1;
uint rs2;
uint imm;
} FormatB;
FormatB parse_FormatB(uint word) {
FormatB ret;
ret.rs1 = (word >> 15) & 0x1f;
ret.rs2 = (word >> 20) & 0x1f;
ret.imm = (word & 0x80000000 ? 0xfffff000 : 0) |
((word << 4) & 0x00000800) |
((word >> 20) & 0x000007e0) |
((word >> 7) & 0x0000001e);
return ret;
}
typedef struct {
uint csr;
uint rs;
uint rd;
uint value;
} FormatCSR;
FormatCSR parse_FormatCSR(uint word) {
FormatCSR ret;
ret.csr = (word >> 20) & 0xfff;
ret.rs = (word >> 15) & 0x1f;
ret.rd = (word >> 7) & 0x1f;
return ret;
}
typedef struct {
uint rd;
uint rs1;
uint imm;
} FormatI;
FormatI parse_FormatI(uint word) {
FormatI ret;
ret.rd = (word >> 7) & 0x1f;
ret.rs1 = (word >> 15) & 0x1f;
ret.imm = (word & 0x80000000 ? 0xfffff800 : 0) |
((word >> 20) & 0x000007ff);
return ret;
}
typedef struct {
uint rd;
uint imm;
} FormatJ;
FormatJ parse_FormatJ(uint word) {
FormatJ ret;
ret.rd = (word >> 7) & 0x1f;
ret.imm = (word & 0x80000000 ? 0xfff00000 : 0) |
(word & 0x000ff000) |
((word & 0x00100000) >> 9) |
((word & 0x7fe00000) >> 20);
return ret;
}
typedef struct {
uint rd;
uint rs1;
uint rs2;
uint rs3;
} FormatR;
FormatR parse_FormatR(uint word) {
FormatR ret;
ret.rd = (word >> 7) & 0x1f;
ret.rs1 = (word >> 15) & 0x1f;
ret.rs2 = (word >> 20) & 0x1f;
ret.rs3 = (word >> 27) & 0x1f;
return ret;
}
typedef struct {
uint rs2;
uint addr;
} FormatS;
FormatS parse_FormatS(uint word) {
FormatS ret;
uint rs1 = (word >> 15) & 0x1f;
ret.rs2 = (word >> 20) & 0x1f;
uint imm = (word & 0x80000000 ? 0xfffff000 : 0) |
((word >> 20) & 0xfe0) |
((word >> 7) & 0x1f);
// special case, FormatS is always treated this way:
ret.addr = xreg(rs1) + imm;
return ret;
}
typedef struct {
uint rd;
uint imm;
} FormatU;
FormatU parse_FormatU(uint word) {
FormatU ret;
ret.rd = (word >> 7) & 0x1f;
ret.imm = word & 0xfffff000;
return ret;
}
typedef struct {
} FormatEmpty;
FormatEmpty parse_FormatEmpty(uint word) {
FormatEmpty ret;
return ret;
}
#endif

27
_Nix/rvc/src/ins.h.meta Executable file
View File

@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: d6882778be5bea443a97bfbf2e4a1b0c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

7
_Nix/rvc/src/main.o.meta Executable file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1ce6e63499e708744a872b825411dea9
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

280
_Nix/rvc/src/mem.h Executable file
View File

@ -0,0 +1,280 @@
#ifndef MEM_H
#define MEM_H
/* must match set/line count above, shift by two to ignore byte offset */
#define RAM_L1_TAG(a) ((a >> 2) & 0xf)
#define WORD_SIZE_NONE 0
#define WORD_SIZE_BYTE 1
#define WORD_SIZE_HALF 2
#define WORD_SIZE_FULL 4
uint mem_get_instruction(uint addr) {
addr = addr & 0x7FFFFFFF;
uint idx = (addr >> 2) & 0x3;
addr = addr >> 4;
uint4 raw = STATE_TEX[RAM_ADDR(addr)];
return idx_uint4(raw, idx);
}
// little endian, zero extended, addr must be aligned to word boundary
uint mem_get_word(uint addr) {
addr &= ~(0x3);
if (addr >= 0x1020 && addr <= 0x1fff) {
uint dtb_addr = addr - 0x1020;
uint dtb_idx = (dtb_addr >> 2) & 0x3;
dtb_addr = dtb_addr >> 4;
float4 full;
[branch]
switch (dtb_idx) {
case 0:
full = _Data_DTB_R[uint2(dtb_addr, 0)];
break;
case 1:
full = _Data_DTB_G[uint2(dtb_addr, 0)];
break;
case 2:
full = _Data_DTB_B[uint2(dtb_addr, 0)];
break;
case 3:
full = _Data_DTB_A[uint2(dtb_addr, 0)];
break;
}
return unpack_raw_float4(full);
}
[branch]
switch (addr) {
// CLINT
case 0x02000000: return cpu.clint.msip ? 1 : 0;
case 0x02004000: return cpu.clint.mtimecmp_lo;
case 0x02004004: return cpu.clint.mtimecmp_hi;
case 0x0200bff8: return cpu.clint.mtime_lo;
case 0x0200bffc: return cpu.clint.mtime_hi;
// UART (first has rbr_thr_ier_iir, second has lcr_mcr_lsr_scr)
case 0x10000000:
uint ret = 0;
if ((UART_GET2(LCR) >> 7) == 0) {
uint rbr = UART_GET1(RBR);
UART_SET1(RBR, 0);
UART_SET2(LSR, (UART_GET2(LSR) & ~LSR_DATA_AVAILABLE));
uart_update_iir();
ret = rbr;
}
return ret | ((UART_GET2(LCR) >> 7 == 0 ? UART_GET1(IER) : 0) << 8) | (UART_GET1(IIR) << 16) | (UART_GET2(LCR) << 24);
/* case 0x10000001: return UART_GET2(LCR) >> 7 == 0 ? UART_GET1(IER) : 0; */
/* case 0x10000002: return UART_GET1(IIR); */
/* case 0x10000003: return UART_GET2(LCR); */
case 0x10000004: return UART_GET2(MCR) | (UART_GET2(LSR) << 8) | (UART_GET2(SCR) << 24);
/* case 0x10000005: return UART_GET2(LSR); */
/* case 0x10000007: return UART_GET2(SCR); */
}
if ((addr & 0x80000000) == 0) {
return 0;
}
addr = addr & 0x7FFFFFFF;
if (addr >= RAM_MAX) {
return 0;
}
return mem_get_cached_or_tex(addr);
}
void mem_set_byte(uint addr, uint val) {
[branch]
switch (addr) {
// UART (first has rbr_thr_ier_iir, second has lcr_mcr_lsr_scr)
case 0x10000000:
if ((UART_GET2(LCR) >> 7) == 0) {
UART_SET1(THR, val);
UART_SET2(LSR, (UART_GET2(LSR) & ~LSR_THR_EMPTY));
uart_update_iir();
}
return;
case 0x10000001:
if (UART_GET2(LCR) >> 7 == 0) {
if ((UART_GET1(IER) & IER_THREINT_BIT) == 0 &&
(val & IER_THREINT_BIT) != 0 &&
UART_GET1(THR) == 0)
{
cpu.uart.thre_ip = true;
}
UART_SET1(IER, val);
uart_update_iir();
}
return;
case 0x10000003: UART_SET2(LCR, val); return;
case 0x10000004: UART_SET2(MCR, val); return;
case 0x10000007: UART_SET2(SCR, val); return;
}
if ((addr & 0x80000000) == 0) {
return;
}
addr = addr & 0x7FFFFFFF;
if (addr >= RAM_MAX) {
return;
}
// caching can cause stalls, so check for same value before storing
uint word_addr = addr & (~0x3);
uint cur_val = mem_get_cached_or_tex(word_addr);
val = (cur_val & ~(0xff << ((addr & 0x3)*8))) | (val << ((addr & 0x3)*8));
if (val != cur_val) {
// put written value into L1 cache
mem_cache_bloom |= word_addr;
[branch]
switch (RAM_L1_TAG(word_addr)) {
case 0:
if (cpu.cache.ram_l1_0_addr == 0xffffffff || cpu.cache.ram_l1_0_addr == word_addr) { cpu.cache.ram_l1_0_addr = word_addr; cpu.cache.ram_l1_0_val = val; return; }
else if (cpu.cache.ram_l1_16_addr == 0xffffffff || cpu.cache.ram_l1_16_addr == word_addr) { cpu.cache.ram_l1_16_addr = word_addr; cpu.cache.ram_l1_16_val = val; return; }
else if (cpu.cache.ram_l1_32_addr == 0xffffffff || cpu.cache.ram_l1_32_addr == word_addr) { cpu.cache.ram_l1_32_addr = word_addr; cpu.cache.ram_l1_32_val = val; return; }
else if (cpu.cache.ram_l1_48_addr == 0xffffffff || cpu.cache.ram_l1_48_addr == word_addr) { cpu.cache.ram_l1_48_addr = word_addr; cpu.cache.ram_l1_48_val = val; return; }
else if (cpu.cache.ram_l1_64_addr == 0xffffffff || cpu.cache.ram_l1_64_addr == word_addr) { cpu.cache.ram_l1_64_addr = word_addr; cpu.cache.ram_l1_64_val = val; return; }
break;
case 1:
if (cpu.cache.ram_l1_1_addr == 0xffffffff || cpu.cache.ram_l1_1_addr == word_addr) { cpu.cache.ram_l1_1_addr = word_addr; cpu.cache.ram_l1_1_val = val; return; }
else if (cpu.cache.ram_l1_17_addr == 0xffffffff || cpu.cache.ram_l1_17_addr == word_addr) { cpu.cache.ram_l1_17_addr = word_addr; cpu.cache.ram_l1_17_val = val; return; }
else if (cpu.cache.ram_l1_33_addr == 0xffffffff || cpu.cache.ram_l1_33_addr == word_addr) { cpu.cache.ram_l1_33_addr = word_addr; cpu.cache.ram_l1_33_val = val; return; }
else if (cpu.cache.ram_l1_49_addr == 0xffffffff || cpu.cache.ram_l1_49_addr == word_addr) { cpu.cache.ram_l1_49_addr = word_addr; cpu.cache.ram_l1_49_val = val; return; }
else if (cpu.cache.ram_l1_65_addr == 0xffffffff || cpu.cache.ram_l1_65_addr == word_addr) { cpu.cache.ram_l1_65_addr = word_addr; cpu.cache.ram_l1_65_val = val; return; }
break;
case 2:
if (cpu.cache.ram_l1_2_addr == 0xffffffff || cpu.cache.ram_l1_2_addr == word_addr) { cpu.cache.ram_l1_2_addr = word_addr; cpu.cache.ram_l1_2_val = val; return; }
else if (cpu.cache.ram_l1_18_addr == 0xffffffff || cpu.cache.ram_l1_18_addr == word_addr) { cpu.cache.ram_l1_18_addr = word_addr; cpu.cache.ram_l1_18_val = val; return; }
else if (cpu.cache.ram_l1_34_addr == 0xffffffff || cpu.cache.ram_l1_34_addr == word_addr) { cpu.cache.ram_l1_34_addr = word_addr; cpu.cache.ram_l1_34_val = val; return; }
else if (cpu.cache.ram_l1_50_addr == 0xffffffff || cpu.cache.ram_l1_50_addr == word_addr) { cpu.cache.ram_l1_50_addr = word_addr; cpu.cache.ram_l1_50_val = val; return; }
else if (cpu.cache.ram_l1_66_addr == 0xffffffff || cpu.cache.ram_l1_66_addr == word_addr) { cpu.cache.ram_l1_66_addr = word_addr; cpu.cache.ram_l1_66_val = val; return; }
break;
case 3:
if (cpu.cache.ram_l1_3_addr == 0xffffffff || cpu.cache.ram_l1_3_addr == word_addr) { cpu.cache.ram_l1_3_addr = word_addr; cpu.cache.ram_l1_3_val = val; return; }
else if (cpu.cache.ram_l1_19_addr == 0xffffffff || cpu.cache.ram_l1_19_addr == word_addr) { cpu.cache.ram_l1_19_addr = word_addr; cpu.cache.ram_l1_19_val = val; return; }
else if (cpu.cache.ram_l1_35_addr == 0xffffffff || cpu.cache.ram_l1_35_addr == word_addr) { cpu.cache.ram_l1_35_addr = word_addr; cpu.cache.ram_l1_35_val = val; return; }
else if (cpu.cache.ram_l1_51_addr == 0xffffffff || cpu.cache.ram_l1_51_addr == word_addr) { cpu.cache.ram_l1_51_addr = word_addr; cpu.cache.ram_l1_51_val = val; return; }
else if (cpu.cache.ram_l1_67_addr == 0xffffffff || cpu.cache.ram_l1_67_addr == word_addr) { cpu.cache.ram_l1_67_addr = word_addr; cpu.cache.ram_l1_67_val = val; return; }
break;
case 4:
if (cpu.cache.ram_l1_4_addr == 0xffffffff || cpu.cache.ram_l1_4_addr == word_addr) { cpu.cache.ram_l1_4_addr = word_addr; cpu.cache.ram_l1_4_val = val; return; }
else if (cpu.cache.ram_l1_20_addr == 0xffffffff || cpu.cache.ram_l1_20_addr == word_addr) { cpu.cache.ram_l1_20_addr = word_addr; cpu.cache.ram_l1_20_val = val; return; }
else if (cpu.cache.ram_l1_36_addr == 0xffffffff || cpu.cache.ram_l1_36_addr == word_addr) { cpu.cache.ram_l1_36_addr = word_addr; cpu.cache.ram_l1_36_val = val; return; }
else if (cpu.cache.ram_l1_52_addr == 0xffffffff || cpu.cache.ram_l1_52_addr == word_addr) { cpu.cache.ram_l1_52_addr = word_addr; cpu.cache.ram_l1_52_val = val; return; }
else if (cpu.cache.ram_l1_68_addr == 0xffffffff || cpu.cache.ram_l1_68_addr == word_addr) { cpu.cache.ram_l1_68_addr = word_addr; cpu.cache.ram_l1_68_val = val; return; }
break;
case 5:
if (cpu.cache.ram_l1_5_addr == 0xffffffff || cpu.cache.ram_l1_5_addr == word_addr) { cpu.cache.ram_l1_5_addr = word_addr; cpu.cache.ram_l1_5_val = val; return; }
else if (cpu.cache.ram_l1_21_addr == 0xffffffff || cpu.cache.ram_l1_21_addr == word_addr) { cpu.cache.ram_l1_21_addr = word_addr; cpu.cache.ram_l1_21_val = val; return; }
else if (cpu.cache.ram_l1_37_addr == 0xffffffff || cpu.cache.ram_l1_37_addr == word_addr) { cpu.cache.ram_l1_37_addr = word_addr; cpu.cache.ram_l1_37_val = val; return; }
else if (cpu.cache.ram_l1_53_addr == 0xffffffff || cpu.cache.ram_l1_53_addr == word_addr) { cpu.cache.ram_l1_53_addr = word_addr; cpu.cache.ram_l1_53_val = val; return; }
else if (cpu.cache.ram_l1_69_addr == 0xffffffff || cpu.cache.ram_l1_69_addr == word_addr) { cpu.cache.ram_l1_69_addr = word_addr; cpu.cache.ram_l1_69_val = val; return; }
break;
case 6:
if (cpu.cache.ram_l1_6_addr == 0xffffffff || cpu.cache.ram_l1_6_addr == word_addr) { cpu.cache.ram_l1_6_addr = word_addr; cpu.cache.ram_l1_6_val = val; return; }
else if (cpu.cache.ram_l1_22_addr == 0xffffffff || cpu.cache.ram_l1_22_addr == word_addr) { cpu.cache.ram_l1_22_addr = word_addr; cpu.cache.ram_l1_22_val = val; return; }
else if (cpu.cache.ram_l1_38_addr == 0xffffffff || cpu.cache.ram_l1_38_addr == word_addr) { cpu.cache.ram_l1_38_addr = word_addr; cpu.cache.ram_l1_38_val = val; return; }
else if (cpu.cache.ram_l1_54_addr == 0xffffffff || cpu.cache.ram_l1_54_addr == word_addr) { cpu.cache.ram_l1_54_addr = word_addr; cpu.cache.ram_l1_54_val = val; return; }
else if (cpu.cache.ram_l1_70_addr == 0xffffffff || cpu.cache.ram_l1_70_addr == word_addr) { cpu.cache.ram_l1_70_addr = word_addr; cpu.cache.ram_l1_70_val = val; return; }
break;
case 7:
if (cpu.cache.ram_l1_7_addr == 0xffffffff || cpu.cache.ram_l1_7_addr == word_addr) { cpu.cache.ram_l1_7_addr = word_addr; cpu.cache.ram_l1_7_val = val; return; }
else if (cpu.cache.ram_l1_23_addr == 0xffffffff || cpu.cache.ram_l1_23_addr == word_addr) { cpu.cache.ram_l1_23_addr = word_addr; cpu.cache.ram_l1_23_val = val; return; }
else if (cpu.cache.ram_l1_39_addr == 0xffffffff || cpu.cache.ram_l1_39_addr == word_addr) { cpu.cache.ram_l1_39_addr = word_addr; cpu.cache.ram_l1_39_val = val; return; }
else if (cpu.cache.ram_l1_55_addr == 0xffffffff || cpu.cache.ram_l1_55_addr == word_addr) { cpu.cache.ram_l1_55_addr = word_addr; cpu.cache.ram_l1_55_val = val; return; }
else if (cpu.cache.ram_l1_71_addr == 0xffffffff || cpu.cache.ram_l1_71_addr == word_addr) { cpu.cache.ram_l1_71_addr = word_addr; cpu.cache.ram_l1_71_val = val; return; }
break;
case 8:
if (cpu.cache.ram_l1_8_addr == 0xffffffff || cpu.cache.ram_l1_8_addr == word_addr) { cpu.cache.ram_l1_8_addr = word_addr; cpu.cache.ram_l1_8_val = val; return; }
else if (cpu.cache.ram_l1_24_addr == 0xffffffff || cpu.cache.ram_l1_24_addr == word_addr) { cpu.cache.ram_l1_24_addr = word_addr; cpu.cache.ram_l1_24_val = val; return; }
else if (cpu.cache.ram_l1_40_addr == 0xffffffff || cpu.cache.ram_l1_40_addr == word_addr) { cpu.cache.ram_l1_40_addr = word_addr; cpu.cache.ram_l1_40_val = val; return; }
else if (cpu.cache.ram_l1_56_addr == 0xffffffff || cpu.cache.ram_l1_56_addr == word_addr) { cpu.cache.ram_l1_56_addr = word_addr; cpu.cache.ram_l1_56_val = val; return; }
else if (cpu.cache.ram_l1_72_addr == 0xffffffff || cpu.cache.ram_l1_72_addr == word_addr) { cpu.cache.ram_l1_72_addr = word_addr; cpu.cache.ram_l1_72_val = val; return; }
break;
case 9:
if (cpu.cache.ram_l1_9_addr == 0xffffffff || cpu.cache.ram_l1_9_addr == word_addr) { cpu.cache.ram_l1_9_addr = word_addr; cpu.cache.ram_l1_9_val = val; return; }
else if (cpu.cache.ram_l1_25_addr == 0xffffffff || cpu.cache.ram_l1_25_addr == word_addr) { cpu.cache.ram_l1_25_addr = word_addr; cpu.cache.ram_l1_25_val = val; return; }
else if (cpu.cache.ram_l1_41_addr == 0xffffffff || cpu.cache.ram_l1_41_addr == word_addr) { cpu.cache.ram_l1_41_addr = word_addr; cpu.cache.ram_l1_41_val = val; return; }
else if (cpu.cache.ram_l1_57_addr == 0xffffffff || cpu.cache.ram_l1_57_addr == word_addr) { cpu.cache.ram_l1_57_addr = word_addr; cpu.cache.ram_l1_57_val = val; return; }
else if (cpu.cache.ram_l1_73_addr == 0xffffffff || cpu.cache.ram_l1_73_addr == word_addr) { cpu.cache.ram_l1_73_addr = word_addr; cpu.cache.ram_l1_73_val = val; return; }
break;
case 10:
if (cpu.cache.ram_l1_10_addr == 0xffffffff || cpu.cache.ram_l1_10_addr == word_addr) { cpu.cache.ram_l1_10_addr = word_addr; cpu.cache.ram_l1_10_val = val; return; }
else if (cpu.cache.ram_l1_26_addr == 0xffffffff || cpu.cache.ram_l1_26_addr == word_addr) { cpu.cache.ram_l1_26_addr = word_addr; cpu.cache.ram_l1_26_val = val; return; }
else if (cpu.cache.ram_l1_42_addr == 0xffffffff || cpu.cache.ram_l1_42_addr == word_addr) { cpu.cache.ram_l1_42_addr = word_addr; cpu.cache.ram_l1_42_val = val; return; }
else if (cpu.cache.ram_l1_58_addr == 0xffffffff || cpu.cache.ram_l1_58_addr == word_addr) { cpu.cache.ram_l1_58_addr = word_addr; cpu.cache.ram_l1_58_val = val; return; }
else if (cpu.cache.ram_l1_74_addr == 0xffffffff || cpu.cache.ram_l1_74_addr == word_addr) { cpu.cache.ram_l1_74_addr = word_addr; cpu.cache.ram_l1_74_val = val; return; }
break;
case 11:
if (cpu.cache.ram_l1_11_addr == 0xffffffff || cpu.cache.ram_l1_11_addr == word_addr) { cpu.cache.ram_l1_11_addr = word_addr; cpu.cache.ram_l1_11_val = val; return; }
else if (cpu.cache.ram_l1_27_addr == 0xffffffff || cpu.cache.ram_l1_27_addr == word_addr) { cpu.cache.ram_l1_27_addr = word_addr; cpu.cache.ram_l1_27_val = val; return; }
else if (cpu.cache.ram_l1_43_addr == 0xffffffff || cpu.cache.ram_l1_43_addr == word_addr) { cpu.cache.ram_l1_43_addr = word_addr; cpu.cache.ram_l1_43_val = val; return; }
else if (cpu.cache.ram_l1_59_addr == 0xffffffff || cpu.cache.ram_l1_59_addr == word_addr) { cpu.cache.ram_l1_59_addr = word_addr; cpu.cache.ram_l1_59_val = val; return; }
else if (cpu.cache.ram_l1_75_addr == 0xffffffff || cpu.cache.ram_l1_75_addr == word_addr) { cpu.cache.ram_l1_75_addr = word_addr; cpu.cache.ram_l1_75_val = val; return; }
break;
case 12:
if (cpu.cache.ram_l1_12_addr == 0xffffffff || cpu.cache.ram_l1_12_addr == word_addr) { cpu.cache.ram_l1_12_addr = word_addr; cpu.cache.ram_l1_12_val = val; return; }
else if (cpu.cache.ram_l1_28_addr == 0xffffffff || cpu.cache.ram_l1_28_addr == word_addr) { cpu.cache.ram_l1_28_addr = word_addr; cpu.cache.ram_l1_28_val = val; return; }
else if (cpu.cache.ram_l1_44_addr == 0xffffffff || cpu.cache.ram_l1_44_addr == word_addr) { cpu.cache.ram_l1_44_addr = word_addr; cpu.cache.ram_l1_44_val = val; return; }
else if (cpu.cache.ram_l1_60_addr == 0xffffffff || cpu.cache.ram_l1_60_addr == word_addr) { cpu.cache.ram_l1_60_addr = word_addr; cpu.cache.ram_l1_60_val = val; return; }
else if (cpu.cache.ram_l1_76_addr == 0xffffffff || cpu.cache.ram_l1_76_addr == word_addr) { cpu.cache.ram_l1_76_addr = word_addr; cpu.cache.ram_l1_76_val = val; return; }
break;
case 13:
if (cpu.cache.ram_l1_13_addr == 0xffffffff || cpu.cache.ram_l1_13_addr == word_addr) { cpu.cache.ram_l1_13_addr = word_addr; cpu.cache.ram_l1_13_val = val; return; }
else if (cpu.cache.ram_l1_29_addr == 0xffffffff || cpu.cache.ram_l1_29_addr == word_addr) { cpu.cache.ram_l1_29_addr = word_addr; cpu.cache.ram_l1_29_val = val; return; }
else if (cpu.cache.ram_l1_45_addr == 0xffffffff || cpu.cache.ram_l1_45_addr == word_addr) { cpu.cache.ram_l1_45_addr = word_addr; cpu.cache.ram_l1_45_val = val; return; }
else if (cpu.cache.ram_l1_61_addr == 0xffffffff || cpu.cache.ram_l1_61_addr == word_addr) { cpu.cache.ram_l1_61_addr = word_addr; cpu.cache.ram_l1_61_val = val; return; }
else if (cpu.cache.ram_l1_77_addr == 0xffffffff || cpu.cache.ram_l1_77_addr == word_addr) { cpu.cache.ram_l1_77_addr = word_addr; cpu.cache.ram_l1_77_val = val; return; }
break;
case 14:
if (cpu.cache.ram_l1_14_addr == 0xffffffff || cpu.cache.ram_l1_14_addr == word_addr) { cpu.cache.ram_l1_14_addr = word_addr; cpu.cache.ram_l1_14_val = val; return; }
else if (cpu.cache.ram_l1_30_addr == 0xffffffff || cpu.cache.ram_l1_30_addr == word_addr) { cpu.cache.ram_l1_30_addr = word_addr; cpu.cache.ram_l1_30_val = val; return; }
else if (cpu.cache.ram_l1_46_addr == 0xffffffff || cpu.cache.ram_l1_46_addr == word_addr) { cpu.cache.ram_l1_46_addr = word_addr; cpu.cache.ram_l1_46_val = val; return; }
else if (cpu.cache.ram_l1_62_addr == 0xffffffff || cpu.cache.ram_l1_62_addr == word_addr) { cpu.cache.ram_l1_62_addr = word_addr; cpu.cache.ram_l1_62_val = val; return; }
else if (cpu.cache.ram_l1_78_addr == 0xffffffff || cpu.cache.ram_l1_78_addr == word_addr) { cpu.cache.ram_l1_78_addr = word_addr; cpu.cache.ram_l1_78_val = val; return; }
break;
case 15:
if (cpu.cache.ram_l1_15_addr == 0xffffffff || cpu.cache.ram_l1_15_addr == word_addr) { cpu.cache.ram_l1_15_addr = word_addr; cpu.cache.ram_l1_15_val = val; return; }
else if (cpu.cache.ram_l1_31_addr == 0xffffffff || cpu.cache.ram_l1_31_addr == word_addr) { cpu.cache.ram_l1_31_addr = word_addr; cpu.cache.ram_l1_31_val = val; return; }
else if (cpu.cache.ram_l1_47_addr == 0xffffffff || cpu.cache.ram_l1_47_addr == word_addr) { cpu.cache.ram_l1_47_addr = word_addr; cpu.cache.ram_l1_47_val = val; return; }
else if (cpu.cache.ram_l1_63_addr == 0xffffffff || cpu.cache.ram_l1_63_addr == word_addr) { cpu.cache.ram_l1_63_addr = word_addr; cpu.cache.ram_l1_63_val = val; return; }
else if (cpu.cache.ram_l1_79_addr == 0xffffffff || cpu.cache.ram_l1_79_addr == word_addr) { cpu.cache.ram_l1_79_addr = word_addr; cpu.cache.ram_l1_79_val = val; return; }
break;
}
// L1 overflow, stall to avoid fillup until L2 flush (TODO) or next frame
cpu.cache.ram_l1_last_addr = word_addr;
cpu.cache.ram_l1_last_val = val;
cpu.stall = STALL_MEM_CACHE_L1;
}
}
void mem_set(uint addr, uint val, uint word_size) {
if (word_size == WORD_SIZE_FULL) {
[branch]
switch (addr & (~0x3)) {
// CLINT/timer - only supports full word write as optimization
case 0x02000000: cpu.clint.msip = (val & 1) != 0; return;
case 0x02004000: cpu.clint.mtimecmp_lo = val; return;
case 0x02004004: cpu.clint.mtimecmp_hi = val; return;
case 0x0200bff8: cpu.clint.mtime_lo = val; return;
case 0x0200bffc: cpu.clint.mtime_hi = val; return;
}
}
[loop]
for (uint i = 0; i < word_size; i++) {
mem_set_byte(addr + i, (val >> (8 * i)) & 0xff);
}
}
#endif

27
_Nix/rvc/src/mem.h.meta Executable file
View File

@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: 0bef11a1bf62d8d4fb1cbb55d82036f5
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

174
_Nix/rvc/src/mem.h.pp Executable file
View File

@ -0,0 +1,174 @@
#ifndef MEM_H
#define MEM_H
<?:include header.p ?>
#define WORD_SIZE_NONE 0
#define WORD_SIZE_BYTE 1
#define WORD_SIZE_HALF 2
#define WORD_SIZE_FULL 4
uint mem_get_instruction(uint addr) {
addr = addr & 0x7FFFFFFF;
uint idx = (addr >> 2) & 0x3;
addr = addr >> 4;
uint4 raw = STATE_TEX[RAM_ADDR(addr)];
return idx_uint4(raw, idx);
}
// little endian, zero extended, addr must be aligned to word boundary
uint mem_get_word(uint addr) {
addr &= ~(0x3);
if (addr >= 0x1020 && addr <= 0x1fff) {
uint dtb_addr = addr - 0x1020;
uint dtb_idx = (dtb_addr >> 2) & 0x3;
dtb_addr = dtb_addr >> 4;
float4 full;
[branch]
switch (dtb_idx) {
case 0:
full = _Data_DTB_R[uint2(dtb_addr, 0)];
break;
case 1:
full = _Data_DTB_G[uint2(dtb_addr, 0)];
break;
case 2:
full = _Data_DTB_B[uint2(dtb_addr, 0)];
break;
case 3:
full = _Data_DTB_A[uint2(dtb_addr, 0)];
break;
}
return unpack_raw_float4(full);
}
[branch]
switch (addr) {
// CLINT
case 0x02000000: return cpu.clint.msip ? 1 : 0;
case 0x02004000: return cpu.clint.mtimecmp_lo;
case 0x02004004: return cpu.clint.mtimecmp_hi;
case 0x0200bff8: return cpu.clint.mtime_lo;
case 0x0200bffc: return cpu.clint.mtime_hi;
// UART (first has rbr_thr_ier_iir, second has lcr_mcr_lsr_scr)
case 0x10000000:
uint ret = 0;
if ((UART_GET2(LCR) >> 7) == 0) {
uint rbr = UART_GET1(RBR);
UART_SET1(RBR, 0);
UART_SET2(LSR, (UART_GET2(LSR) & ~LSR_DATA_AVAILABLE));
uart_update_iir();
ret = rbr;
}
return ret | ((UART_GET2(LCR) >> 7 == 0 ? UART_GET1(IER) : 0) << 8) | (UART_GET1(IIR) << 16) | (UART_GET2(LCR) << 24);
/* case 0x10000001: return UART_GET2(LCR) >> 7 == 0 ? UART_GET1(IER) : 0; */
/* case 0x10000002: return UART_GET1(IIR); */
/* case 0x10000003: return UART_GET2(LCR); */
case 0x10000004: return UART_GET2(MCR) | (UART_GET2(LSR) << 8) | (UART_GET2(SCR) << 24);
/* case 0x10000005: return UART_GET2(LSR); */
/* case 0x10000007: return UART_GET2(SCR); */
}
if ((addr & 0x80000000) == 0) {
return 0;
}
addr = addr & 0x7FFFFFFF;
if (addr >= RAM_MAX) {
return 0;
}
return mem_get_cached_or_tex(addr);
}
void mem_set_byte(uint addr, uint val) {
[branch]
switch (addr) {
// UART (first has rbr_thr_ier_iir, second has lcr_mcr_lsr_scr)
case 0x10000000:
if ((UART_GET2(LCR) >> 7) == 0) {
UART_SET1(THR, val);
UART_SET2(LSR, (UART_GET2(LSR) & ~LSR_THR_EMPTY));
uart_update_iir();
}
return;
case 0x10000001:
if (UART_GET2(LCR) >> 7 == 0) {
if ((UART_GET1(IER) & IER_THREINT_BIT) == 0 &&
(val & IER_THREINT_BIT) != 0 &&
UART_GET1(THR) == 0)
{
cpu.uart.thre_ip = true;
}
UART_SET1(IER, val);
uart_update_iir();
}
return;
case 0x10000003: UART_SET2(LCR, val); return;
case 0x10000004: UART_SET2(MCR, val); return;
case 0x10000007: UART_SET2(SCR, val); return;
}
if ((addr & 0x80000000) == 0) {
return;
}
addr = addr & 0x7FFFFFFF;
if (addr >= RAM_MAX) {
return;
}
// caching can cause stalls, so check for same value before storing
uint word_addr = addr & (~0x3);
uint cur_val = mem_get_cached_or_tex(word_addr);
val = (cur_val & ~(0xff << ((addr & 0x3)*8))) | (val << ((addr & 0x3)*8));
if (val != cur_val) {
// put written value into L1 cache
mem_cache_bloom |= word_addr;
[branch]
switch (RAM_L1_TAG(word_addr)) {
<?
for my $i (0..$ram_l1_set_max) {
print "case $i:\n";
for my $j (0..$ram_l1_line_max) {
my $ci = $i + $j * ($ram_l1_set_max + 1);
my $e = $j == 0 ? " " : "else";
print "$e if (cpu.cache.ram_l1_${ci}_addr == 0xffffffff || cpu.cache.ram_l1_${ci}_addr == word_addr) { cpu.cache.ram_l1_${ci}_addr = word_addr; cpu.cache.ram_l1_${ci}_val = val; return; }\n";
}
print "break;\n"
}
?>
}
// L1 overflow, stall to avoid fillup until L2 flush (TODO) or next frame
cpu.cache.ram_l1_last_addr = word_addr;
cpu.cache.ram_l1_last_val = val;
cpu.stall = STALL_MEM_CACHE_L1;
}
}
void mem_set(uint addr, uint val, uint word_size) {
if (word_size == WORD_SIZE_FULL) {
[branch]
switch (addr & (~0x3)) {
// CLINT/timer - only supports full word write as optimization
case 0x02000000: cpu.clint.msip = (val & 1) != 0; return;
case 0x02004000: cpu.clint.mtimecmp_lo = val; return;
case 0x02004004: cpu.clint.mtimecmp_hi = val; return;
case 0x0200bff8: cpu.clint.mtime_lo = val; return;
case 0x0200bffc: cpu.clint.mtime_hi = val; return;
}
}
[loop]
for (uint i = 0; i < word_size; i++) {
mem_set_byte(addr + i, (val >> (8 * i)) & 0xff);
}
}
#endif

7
_Nix/rvc/src/mem.h.pp.meta Executable file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: acbbe536ff8198442bc21259d2d4de83
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

154
_Nix/rvc/src/mmu.h Executable file
View File

@ -0,0 +1,154 @@
#ifndef MMU_H
#define MMU_H
#include "types.h"
void mmu_update(uint satp) {
cpu.mmu.mode = satp >> 31;
cpu.mmu.ppn = satp & 0x7fffffff;
}
#include "mem.h"
#include "trap.h"
#define MMU_MODE_OFF 0
#define MMU_MODE_SV32 1
#define MMU_ACCESS_FETCH 0
#define MMU_ACCESS_READ 1
#define MMU_ACCESS_WRITE 2
#define PAGESIZE 4096
#define PTESIZE 4
#define ADDR_PART_OFFSET(x) ((x >> 0) & 0xfff)
#define ADDR_PART_PN0(x) ((x >> 12) & 0x3ff)
#define ADDR_PART_PN1(x) ((x >> 22) & 0xfff)
typedef struct {
bool v, r, w, x, u, g, a, d;
uint rsw;
uint ppn0;
uint ppn1;
} mmu_page;
uint get_trap_type(uint mode) {
return mode == MMU_ACCESS_FETCH ? trap_InstructionPageFault :
(mode == MMU_ACCESS_READ ? trap_LoadPageFault : trap_StorePageFault);
}
uint get_effective_privilege(out uint sum, out uint mxr) {
uint mstatus = read_csr_raw(CSR_MSTATUS);
sum = (mstatus >> 18) & 0x1;
mxr = (mstatus >> 19) & 0x1;
if ((mstatus >> 17) & 0x1) {
// TODO: Check if this shouldn't be 9
return (mstatus >> 11) & 0x3;
}
return cpu.csr.privilege;
}
mmu_page load_page(uint addr) {
uint data = mem_get_cached_or_tex(addr & 0x7ffffffc);
mmu_page ret;
#define BOOL(name, bit) ret.name = (data >> bit) & 0x1;
BOOL(v, 0)
BOOL(r, 1)
BOOL(w, 2)
BOOL(x, 3)
BOOL(u, 4)
BOOL(g, 5)
BOOL(a, 6)
BOOL(d, 7)
#undef BOOL
ret.rsw = (data >> 8) & 0x3;
ret.ppn0 = (data >> 10) & 0x3ff;
ret.ppn1 = (data >> 20) & 0xfff;
return ret;
}
uint mmu_translate(inout ins_ret ins, uint addr, uint mode) {
if (cpu.mmu.mode == MMU_MODE_OFF) {
return addr;
}
#define FAULT \
ins.trap.en = true; \
ins.trap.type = get_trap_type(mode); \
ins.trap.value = addr; \
return 0;
uint sum, mxr;
uint priv = get_effective_privilege(sum, mxr);
// machine mode fetch will always use physical addresses, otherwise 'mxr'
// defines if paging will be used
if (priv == PRIV_MACHINE || (cpu.csr.privilege == PRIV_MACHINE && mode == MMU_ACCESS_FETCH)) {
return addr;
}
bool super;
mmu_page page;
// perform two-layer page walk, exit early in case of super page
[loop]
for (uint im = 0; im < 2; im++) {
uint page_addr = im == 0 ?
(cpu.mmu.ppn * PAGESIZE + ADDR_PART_PN1(addr) * PTESIZE) :
((page.ppn0 | (page.ppn1 << 10)) * PAGESIZE + ADDR_PART_PN0(addr) * PTESIZE);
page = load_page(page_addr);
super = im == 0;
if (!page.v || (!page.r && page.w)) {
FAULT
}
if (page.r || page.x) {
break;
} else if (im == 1) {
// non-leaf page at bottom level
FAULT
}
}
// PTE has been found, permission check
bool perm =
priv == PRIV_MACHINE || // machine can read everything
(priv == PRIV_USER && page.u) || // this is a user page
(priv == PRIV_SUPERVISOR && (!page.u || sum)); // supervisor page or SUM
bool access =
(mode == MMU_ACCESS_FETCH && page.x) ||
(mode == MMU_ACCESS_READ && (page.r || (page.x && mxr))) ||
(mode == MMU_ACCESS_WRITE && page.w);
bool allowed = perm && access;
if (!allowed) {
/* access permission fault */
FAULT
}
if (super && page.ppn0 != 0) {
/* misaligned super page fault */
FAULT
}
if (!page.a || (mode == MMU_ACCESS_WRITE && !page.d)) {
/* access/dirty bit fault */
FAULT
}
// translation success
uint pa = ADDR_PART_OFFSET(addr);
pa |= super ? ADDR_PART_PN0(addr) << 12 : page.ppn0 << 12;
pa |= page.ppn1 << 22;
/* cpu.debug_arb_1 = pa; */
/* if (!(pa & 0x80000000) || (pa & 0x7fffffff) >= RAM_MAX) { */
/* FAULT */
/* } */
return pa;
}
#endif

Some files were not shown because too many files have changed in this diff Show More