Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.0 on 2022-01-18 at 14:00 UTC+1 (a few minutes of down time)

Commit 1bb1bca2 authored by a1ex's avatar a1ex
Browse files

Merged unified into patchmgr

--HG--
branch : patchmgr
......@@ -33,6 +33,10 @@ all::
$(call build,AS,$(CC) $(AFLAGS) -c -o $@ $<)
%.o: %.c
$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
autoexec.bin: autoexec $(XOR_CHK)
$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
$(call build,XOR_CHK,$(XOR_CHK) $@)
%.bin: %
$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
$(call build,STAT,$(STAT_CMD) $@)
......
......@@ -25,6 +25,9 @@ MODULES_DIR=$(TOP_DIR)/modules
BIN_FILES=magiclantern magiclantern.bin autoexec.bin autoexec
CF_CARD_ML_DIR = $(CF_CARD)/ML
BUILD_TOOLS_DIR=$(TOP_DIR)/build_tools
XOR_CHK=$(BUILD_TOOLS_DIR)/xor_chk
INSTALL_DIR ?= $(CF_CARD)
INSTALL_ML_DIR = $(INSTALL_DIR)/ML
INSTALL_FONTS_DIR= $(INSTALL_ML_DIR)/fonts
......
......@@ -137,6 +137,7 @@ CONFIG_TINYPY = n
# Work in progress - would be nice to run the unmodified autoexec.bin in QEMU, but we are not there yet
# so, for now, we'll just hack the source code to work around the limitations of the emulator
CONFIG_QEMU = n
CONFIG_QEMU_MENU_SCREENSHOTS = n
# Work in progress - load ML as position-independent code (PIC)
CONFIG_PIC = n
# Makefile for the various tools used in the build process
ifndef TOP_DIR
# if this is used as a standalone makefile, we need to include some additional stuff
TOP_DIR=..
include $(TOP_DIR)/Makefile.setup
endif
$(XOR_CHK): $(XOR_CHK).c
$(call build,XOR_CHK,$(HOST_CC) $< -o $@)
clean::
$(call rm_files, $(XOR_CHK))
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
if(argc != 2)
{
printf("Invalid parameter count (%d)\n", argc);
return -1;
}
FILE *f = fopen(argv[1], "r+");
if(!f)
{
printf("Failed to open file\n");
return -1;
}
uint32_t checksum = 0;
uint32_t data = 0;
uint32_t read = 0;
/* make sure we read from the beginning */
fseek(f, 0, SEEK_SET);
while(!feof(f))
{
if(fread(&data, 4, 1, f) != 1)
{
break;
}
checksum ^= data;
read++;
}
/* modify checksum */
data ^= checksum;
fseek(f, -4, SEEK_END);
if(fwrite(&data, 4, 1, f) != 1)
{
printf("Failed to write\n");
return -1;
}
fclose(f);
return 0;
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,8 +10,13 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EOSMovieFixer</RootNamespace>
<AssemblyName>EOSMovieFixer</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -107,6 +112,7 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
......
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:2.0.50727.5456
// Laufzeitversion:4.0.30319.34014
//
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
// der Code neu generiert wird.
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace EOSMovieFixer.Properties
{
namespace EOSMovieFixer.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
// über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EOSMovieFixer.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}
......
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.5456
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace EOSMovieFixer.Properties
{
namespace EOSMovieFixer.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
......@@ -26,8 +26,13 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LensDumper</RootNamespace>
<AssemblyName>LensDumper</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,8 +10,13 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MLVBrowseSharp</RootNamespace>
<AssemblyName>MLVBrowseSharp</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -135,6 +140,7 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
......
......@@ -144,7 +144,7 @@ namespace MLVBrowseSharp
pictureBox.Refresh();
}
textLabel.Text = FileInfo.Name + Environment.NewLine + "(Frame " + (Handler.VidfHeader.frameNumber + 1) + "/" + Reader.TotalFrameCount + ")";
textLabel.Text = FileInfo.Name + Environment.NewLine + "(Frame " + (Handler.VidfHeader.frameNumber + 1) + "/" + (Reader.HighestVideoFrameNumber + 1) + ")";
if (Reader.FrameErrors > 0)
{
......
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:2.0.50727.5472
// Laufzeitversion:4.0.30319.34014
//
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
// der Code neu generiert wird.
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MLVBrowseSharp.Properties
{
namespace MLVBrowseSharp.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
// über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MLVBrowseSharp.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}
......
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.5472
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MLVBrowseSharp.Properties
{
namespace MLVBrowseSharp.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}
......
......@@ -132,9 +132,12 @@ namespace MLVViewSharp
}
/* get the XYZ --> cone reference whites for requested temperatures */
Matrix dst = coneDomain * KelvinToXYZ(ColorTemperature);
Matrix temp = KelvinToXYZ(ColorTemperature);
/* verify: do all our matrices that came from dcraw really convert raw to D65? */
Matrix src = coneDomain * KelvinToXYZ(6500);
Matrix tempD65 = KelvinToXYZ(6500);
Matrix dst = coneDomain * temp;
Matrix src = coneDomain * tempD65;
/* scale coordinates in cone color space */
Matrix xyzScale = new Matrix(3, 3);
......
......@@ -17,17 +17,18 @@ namespace mlv_view_sharp
public class MLVHandler
{
public Bitmap CurrentFrame;
private LockBitmap LockBitmap = null;
public LockBitmap LockBitmap = null;
public bool FrameUpdated = false;
internal float _ExposureCorrection = 0.0f;
internal Lut3D ColorLut = null;
public int RawFixOffset = 0;
public bool VideoEnabled = true;
public bool DebayeringEnabled = true;
public bool AudioEnabled = true;
private WaveOut DriverOut;
private BufferedWaveProvider WaveProvider;
public BufferedWaveProvider WaveProvider;
public MLVTypes.mlv_rawi_hdr_t RawiHeader;
......@@ -39,14 +40,18 @@ namespace mlv_view_sharp
public MLVTypes.mlv_styl_hdr_t StylHeader;
public MLVTypes.mlv_wbal_hdr_t WbalHeader;
public MLVTypes.mlv_vidf_hdr_t VidfHeader;
public MLVTypes.mlv_wavi_hdr_t WaviHeader;
public MLVTypes.mlv_audf_hdr_t AudfHeader;
public string InfoString = "";
private Debayer Debayer = new DebayerHalfRes(0);
private BitUnpack Bitunpack = new BitUnpackCanon();
private ushort[,] PixelData = new ushort[0, 0];
private float[, ,] RGBData = new float[0, 0, 0];
public byte[] RawPixelData = new byte[0];
public ushort[,] PixelData = new ushort[0, 0];
public float[, ,] RGBData = new float[0, 0, 0];
float[] camMatrix = new float[] { 0.6722f, -0.0635f, -0.0963f, -0.4287f, 1.2460f, 0.2028f, -0.0908f, 0.2162f, 0.5668f };
......@@ -97,6 +102,7 @@ namespace mlv_view_sharp
public void HandleBlock(string type, MLVTypes.mlv_wavi_hdr_t header, byte[] raw_data, int raw_pos, int raw_length)
{
WaviHeader = header;
if (DriverOut != null)
{
DriverOut.Stop();
......@@ -165,6 +171,7 @@ namespace mlv_view_sharp
public void HandleBlock(string type, MLVTypes.mlv_audf_hdr_t header, byte[] rawData, int rawPos, int rawLength)
{
AudfHeader = header;
if (WaveProvider != null)
{
while (WaveProvider.BufferedBytes + (int)(rawLength - header.frameSpace) > WaveProvider.BufferLength)
......@@ -191,7 +198,16 @@ namespace mlv_view_sharp
lock (this)
{
int startPos = rawPos + (int)Math.Max(header.frameSpace - RawFixOffset, 0);
int frameSpace = (int)Math.Max(header.frameSpace - RawFixOffset, 0);
int startPos = rawPos + frameSpace;
int length = rawLength - frameSpace;
if (!DebayeringEnabled)
{
RawPixelData = new byte[length];
Array.Copy(rawData, startPos, RawPixelData, 0, length);
return;
}
/* first extract the raw channel values */
Bitunpack.Process(rawData, startPos, rawLength, PixelData);
......@@ -319,6 +335,32 @@ namespace mlv_view_sharp
}
}
public DateTime ParseRtci(MLVTypes.mlv_rtci_hdr_t rtci)
{
ushort tm_year = (ushort)(rtci.tm_year + 1900);
ushort tm_mon = rtci.tm_mon;
ushort tm_mday = rtci.tm_mday;
ushort tm_hour = rtci.tm_hour;
ushort tm_min = rtci.tm_min;
ushort tm_sec = rtci.tm_sec;
if (tm_year > 1900 && tm_mon > 0 && tm_mday > 0)
{
try
{
return new DateTime(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec);
}
catch (Exception e)
{
}
}
else
{
}
return DateTime.Now;
}
public void SelectDebayer(int downscale)
{
lock (this)
......