2019-08-23 11:56:54 -07:00
|
|
|
|
|
|
|
//♀Farts
|
|
|
|
//Ãjaxa̐ḁ
|
|
|
|
|
|
|
|
//#if false
|
|
|
|
|
|
|
|
#pragma warning disable 168
|
|
|
|
|
|
|
|
//zab1234
|
|
|
|
|
|
|
|
// Zoop
|
|
|
|
//using IDE;
|
|
|
|
using System;
|
2019-09-29 07:44:39 -07:00
|
|
|
//using System.Threading;
|
2019-08-23 11:56:54 -07:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections;
|
2019-09-29 07:44:39 -07:00
|
|
|
using System.Threading;
|
2019-08-23 11:56:54 -07:00
|
|
|
|
|
|
|
// Disable unused variable warning
|
|
|
|
#pragma warning disable 168
|
|
|
|
|
|
|
|
public enum QIntDisplayType
|
|
|
|
{
|
|
|
|
Default,
|
|
|
|
Decimal,
|
|
|
|
Hexadecimal,
|
|
|
|
Binary,
|
|
|
|
COUNT
|
|
|
|
}
|
|
|
|
|
2020-04-10 08:58:12 -07:00
|
|
|
[CRepr]
|
|
|
|
public struct ALLEGRO_COLOR
|
|
|
|
{
|
|
|
|
public float r, g, b, a;
|
|
|
|
}
|
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
namespace Hey.Dude.Bro
|
|
|
|
{
|
|
|
|
class TestClass
|
|
|
|
{
|
2019-12-11 16:56:09 -08:00
|
|
|
static int gApzong = 123;
|
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
[CLink, StdCall]
|
|
|
|
public static extern void OutputDebugStringA(char8* str);
|
|
|
|
|
|
|
|
/*[CLink, StdCall]
|
|
|
|
internal static extern void OutputDebugStringW(char16* str);*/
|
|
|
|
|
|
|
|
[CLink, StdCall]
|
|
|
|
public static extern uint32 GetTickCount();
|
|
|
|
|
|
|
|
[Import("winmm.lib"), CLink, StdCall]
|
|
|
|
public static extern uint32 timeGetTime();
|
|
|
|
|
|
|
|
/*public const String cDllName = @"C:\proj\TestDLL2\x64\Debug\TestDLL2.dll";
|
|
|
|
[DllImport(cDllName), CLink, StdCall]
|
|
|
|
public static extern void Test2(int a, int b, int c, int d);*/
|
|
|
|
|
|
|
|
//[DllImport(cDllName), CLink, StdCall] public static extern void Test3();
|
|
|
|
|
|
|
|
//[DllImport(@"C:\Beef\IDE\dist\IDEHelper64_d.dll"), CLink, StdCall]
|
|
|
|
//public static extern void BFTest();
|
|
|
|
|
|
|
|
/*[StdCall, CLink]
|
|
|
|
public static extern void ExTest2();*/
|
|
|
|
|
|
|
|
//[DllImport(@"\beef\ide\dist\TestDLL.dll"), CLink]
|
|
|
|
//[DllImport(@"C:\Beef\BeefTools\TestDLL\x64\Debug\TestDLL.dll"), CLink]
|
|
|
|
|
|
|
|
#if BF_64_BIT
|
|
|
|
[Import(@"C:\Beef\BeefTools\TestDLL\x64\Debug\TestDLL.dll"), LinkName("Test2")]
|
|
|
|
public static extern void Test2(int32 a, int32 b, int32 c, int32 d);
|
2020-04-10 08:58:12 -07:00
|
|
|
|
|
|
|
[Import(@"C:\Beef\BeefTools\TestDLL\x64\Debug\TestDLL.dll"), LinkName("Test3")]
|
|
|
|
public static extern void Test3(void* ptr, ALLEGRO_COLOR color);
|
2019-08-23 11:56:54 -07:00
|
|
|
#else
|
|
|
|
[Import(@"C:\Beef\BeefTools\TestDLL\Debug\TestDLL.dll"), LinkName("Test2")]
|
|
|
|
public static extern void Test2(int32 a, int32 b, int32 c, int32 d);
|
2020-04-10 08:58:12 -07:00
|
|
|
|
|
|
|
[Import(@"C:\Beef\BeefTools\TestDLL\Debug\TestDLL.dll"), LinkName("Test3")]
|
|
|
|
public static extern void Test3(void* ptr, ALLEGRO_COLOR color);
|
|
|
|
|
|
|
|
[Import(@"C:\Beef\BeefTools\TestDLL\Debug\TestDLL.dll"), LinkName("Test4")]
|
|
|
|
public static extern void Test4(void* ptr, ALLEGRO_COLOR* color);
|
2019-08-23 11:56:54 -07:00
|
|
|
#endif
|
|
|
|
|
2020-04-10 08:58:12 -07:00
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
static uint32 sStaticVar = 234;
|
|
|
|
|
|
|
|
public static int FartsieInt<T>(T val) where T : const int
|
|
|
|
{
|
|
|
|
return T;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void UseTC(QIntDisplayType tc)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int Fartsie<T>(TypeCode tc, T val = .Boolean) where T : const TypeCode
|
|
|
|
{
|
|
|
|
TypeCode tc2 = val;
|
|
|
|
|
|
|
|
UseTC((QIntDisplayType)val | .Binary);
|
|
|
|
//return (int)T;
|
|
|
|
return 99;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void MethodA(int a, TypeCode b = .Char16)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void MethodA<T>(int a, TypeCode b, T c) where T : const TypeCode
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static int Test()
|
|
|
|
{
|
|
|
|
//for (int i < 20)
|
|
|
|
for (int i < 50)
|
|
|
|
{
|
|
|
|
//OutputDebugStringA("Test......................................\r\n");
|
|
|
|
Thread.Sleep(100);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 123;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int64 foo(int32 *x, int64 *y)
|
|
|
|
{
|
|
|
|
*x = 0;
|
|
|
|
*y = 1;
|
|
|
|
return *x;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum EnumA
|
|
|
|
{
|
|
|
|
case Abc;
|
|
|
|
case Def;
|
|
|
|
|
|
|
|
public static EnumA Gorf()
|
|
|
|
{
|
|
|
|
return Abc;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static EnumA Gorzom()
|
|
|
|
{
|
|
|
|
return .Def;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Goo()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-11 16:56:09 -08:00
|
|
|
enum EnumB
|
|
|
|
{
|
|
|
|
AAA,
|
|
|
|
BBB
|
|
|
|
}
|
|
|
|
|
|
|
|
enum EnumC
|
|
|
|
{
|
|
|
|
CCC,
|
|
|
|
DDD
|
|
|
|
}
|
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
static void Flarg()
|
|
|
|
{
|
|
|
|
EnumA ea;
|
|
|
|
Test();
|
|
|
|
}
|
|
|
|
|
|
|
|
static int RunLong()
|
|
|
|
{
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
return 999;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void Thread()
|
|
|
|
{
|
|
|
|
int a = 123;
|
|
|
|
PrintF("A...\n");
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
PrintF("B...\n");
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
PrintF("C...\n");
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
PrintF("D...\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int GetVal()
|
|
|
|
{
|
|
|
|
return 111;
|
|
|
|
}
|
|
|
|
|
2019-09-20 09:21:29 -07:00
|
|
|
public static void TestA()
|
2019-08-23 11:56:54 -07:00
|
|
|
{
|
2019-09-20 09:21:29 -07:00
|
|
|
int* a = null;
|
|
|
|
*a = 123;
|
|
|
|
}
|
2019-09-12 09:48:38 -07:00
|
|
|
|
2019-09-29 07:44:39 -07:00
|
|
|
public static int32 SEHHandler(void* ptr)
|
|
|
|
{
|
|
|
|
PrintF("SEH Handler at root\n");
|
|
|
|
//Thread.Sleep(15000);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[CRepr, CLink]
|
|
|
|
public static extern void* SetUnhandledExceptionFilter(function int32(void* p) func);
|
|
|
|
|
2019-10-09 16:20:09 -07:00
|
|
|
public static int GetHash<T>(T val) where T : IHashable
|
2019-09-20 09:21:29 -07:00
|
|
|
{
|
2019-10-09 16:20:09 -07:00
|
|
|
return val.GetHashCode();
|
|
|
|
}
|
2019-09-29 07:44:39 -07:00
|
|
|
|
2019-12-11 16:56:09 -08:00
|
|
|
class Zangles
|
|
|
|
{
|
|
|
|
public static int GetMe(Zangles zang, String str)
|
|
|
|
{
|
|
|
|
return 99;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-25 12:43:45 -08:00
|
|
|
public static void Florgs()
|
2019-10-09 16:20:09 -07:00
|
|
|
{
|
2019-11-25 06:48:19 -08:00
|
|
|
|
2019-12-25 12:43:45 -08:00
|
|
|
}
|
2019-11-25 06:48:19 -08:00
|
|
|
|
2019-12-25 12:43:45 -08:00
|
|
|
public static int Main(String[] args)
|
|
|
|
{
|
2019-08-27 08:04:41 -07:00
|
|
|
Blurg.Hey();
|
2019-08-29 14:19:07 -07:00
|
|
|
return 1;
|
2019-08-23 11:56:54 -07:00
|
|
|
}
|
2019-09-29 07:44:39 -07:00
|
|
|
|
|
|
|
public static this()
|
|
|
|
{
|
|
|
|
//Runtime.TestCrash();
|
|
|
|
}
|
2019-08-23 11:56:54 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public struct Color : uint32
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Florf
|
|
|
|
{
|
|
|
|
public int Zorg()
|
|
|
|
{
|
|
|
|
return 42;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int Goof()
|
|
|
|
{
|
|
|
|
return Zorg();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct StructAz
|
|
|
|
{
|
|
|
|
public struct StructB
|
|
|
|
{
|
|
|
|
|
|
|
|
public struct StructC
|
|
|
|
{
|
|
|
|
public static void MethodC0()
|
|
|
|
{
|
|
|
|
MethodA0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void MethodB0()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void MethodA0()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace IDE
|
|
|
|
{
|
|
|
|
static
|
|
|
|
{
|
|
|
|
public static Object gApp = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
{
|
|
|
|
public static Object gApp2 = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace AA
|
|
|
|
{
|
|
|
|
namespace BB
|
|
|
|
{
|
|
|
|
namespace CC
|
|
|
|
{
|
|
|
|
static
|
|
|
|
{
|
|
|
|
public static int gValue = 123;
|
|
|
|
public static String gStr = "Hey";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
{
|
2019-12-11 16:56:09 -08:00
|
|
|
static int gApsings = 123;
|
2019-08-23 11:56:54 -07:00
|
|
|
}
|
2019-12-11 16:56:09 -08:00
|
|
|
|
2019-12-25 12:43:45 -08:00
|
|
|
/*namespace zSquarf
|
|
|
|
{
|
|
|
|
class Zorf
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}*/
|