Skip to content

Instantly share code, notes, and snippets.

View gitlarryf's full-sized avatar

Larry Frieson gitlarryf

View GitHub Profile
@gitlarryf
gitlarryf / mvi69.cpp
Created October 30, 2019 19:21
MVI69E-LDM Neon Extension module implementation
#include <string>
#include <vector>
#include "mvi69api.h"
#include "neonext.h"
const char *Exception_LDMException = "LDMException";
const Ne_MethodTable *Ne;
@gitlarryf
gitlarryf / string.neon
Created October 14, 2019 19:47
New proposed function for string.neon
EXPORT FUNCTION fromHex(val: String): Number
VAR value: Number := 0
VAR HexStr: String := ""
FOREACH c IN string.lower(val) DO
IF c IN ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "x", "h"] THEN
HexStr := HexStr & string.lower(c)
END IF
END FOREACH
IF HexStr.length() = 0 THEN
RETURN value
@gitlarryf
gitlarryf / mvi69api.h
Created September 24, 2019 15:54
MVI69E-LDM Backplane API header file
/** $Revision: 1.1 $ **/
/************************************************************************
*
* Title: MVI69E API library header file
*
* Abstract:
*
* Contains defininitions, structures, and function templates for
* all functions defined in the MVI69E API. This file is
@gitlarryf
gitlarryf / cnex.cmd
Last active September 4, 2019 16:47
Batch file to compile .neon before executing with explicit Neon executor.
@ECHO OFF
SETLOCAL
SET NeonPath=f:\dropbox\projects\neon-lang\neon-lang\
SET NeonCompiler=bin\neonc.exe
SET NeonExecutor=exec\cnex\cnex.exe
SET Space=
:ParseParams
IF /i "%~x1"==".NEON" SET NeonName=%1
IF /i "%~x1"==".NEONX" GOTO:run
@gitlarryf
gitlarryf / test_path_support.c
Created August 23, 2019 20:29
Test file for support.c
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "support.h"
void main()
{
@gitlarryf
gitlarryf / Bytecode.neon
Created June 8, 2019 00:22
Neon Bytecode support file
%|
| File: Bytecode
|
| Functions for creating, reading and writing Neon bytecode.
|%
IMPORT file
IMPORT hash
IMPORT struct
%|
@gitlarryf
gitlarryf / xAutoUpdate.xml
Created May 11, 2019 03:45
This is my own personal AutoUpdate service written in C#. This is the manifest file for performing an update. This code could be used as a model for a more modern auto update mechanism.
<?xml version="1.0" encoding="utf-8"?>
<xAutoUpdate xmlns="http://www.xceldata.com/Schemas/xAutoUpdate" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xceldata.com/Schemas/xAutoUpdate xAutoUpdate.xsd" xsi:type="xAutoUpdate.xsd">
<!-- <xAutoUpdate> -->
<xProject ProjectName="PawnStats Mini-Server" ID="54E523D6">
<UpdatePackage SerialNumber="0" UpdateVersion="2.0.0.103" ReleaseDate="2013-01-31T19:45:32" BackupCurrentFiles="true" Rollback="false">
<!--
Unique ID's:
Packages, and xProjects include a UniqueID system that involves taking the CRC32 value of the PROJECT NAME, or the COMPONENT NAME
and providing the CRC32 value as the ID. This ID *MUST* match the Name, or the entire object is considered invalid and will
not be processed. Note that if the xProject ID isn't set, or is incorrect, ALL components under it will not even be attempted.
@gitlarryf
gitlarryf / serial.neon
Created April 11, 2019 20:26
Early prototype Neon Serial library
%|
| File: serial
|
| Provides access to physical serial ports, and USB to Serial adapters, allowing Neon
| the ability to interface with many devices.
|%
EXPORT Port
TYPE Port IS POINTER
@gitlarryf
gitlarryf / mathlib.h
Created February 20, 2019 21:55
Header file for mathlib.
#pragma once
enum { ROUND_NONE, ROUND_UP, ROUND_DOWN, ROUND_PROXIMITY };
double AddFloats(double d1, double d2);
double SubtractFloats(double d1, double d2);
double MultiplyFloats(double d1, double d2);
DECIMAL &operator^(DECIMAL &qVal, int iPower);
double Round(double dNumber, int iRoundMethod);
@gitlarryf
gitlarryf / mathlib.cpp
Created February 20, 2019 21:50
DECIMAL (fixed point) based math library functions.
#include "MathLib.h"
#include "stdafx.h"
enum { ROUND_NONE, ROUND_UP, ROUND_DOWN, ROUND_PROXIMITY };
DECIMAL &operator^(DECIMAL &qVal, int iPower)
{
for(int x = 1;x < iPower;x++)
{
qVal.Lo64 *=(1*10);