Skip to content

Instantly share code, notes, and snippets.

@asfdrwe
asfdrwe / TD4.v
Created September 19, 2021 03:30
4bit CPU TD4 Verilog implementation
// Copyright (c) 2021 asfdrwe (asfdrwe@gmail.com)
// SPDX-License-Identifier: MIT
// USAGE: iverilog -o TD4 TD4.v && ./TD4 # PROGRAM => ROM.bin
module TD4(input wire cl,input wire rn,input wire[3:0]in,output wire[3:0]po,output wire[7:0]op,output wire[3:0]ou,output wire[3:0]ad);reg[3:0]ra,rb,ro;reg[3:0]pc=4'b0;reg cf=1'b1;assign ou=ro;assign po=pc;reg[7:0]rm[0:15];initial $readmemb("ROM.bin",rm);wire[7:0]oc;assign oc=rm[pc];assign op=oc;wire[1:0]as,ls;wire jm;wire[3:0]im;assign as=(oc[7:6]==2'b11)?2'b11:oc[5:4];assign ls=oc[7:6];assign jm=oc[4];assign im=oc[3:0];wire[3:0]ai;assign ai=(as==2'b00)?ra:(as==2'b01)?rb:(as==2'b10)?in:4'b0;wire[3:0]al;wire nf;assign {nf,al}=ai+im;assign ad=al;wire la,lb,lo,lp;assign la=(ls==2'b00)?1'b0:1'b1;assign lb=(ls==2'b01)?1'b0:1'b1;assign lo=(ls==2'b10)?1'b0:1'b1;assign lp=(ls==2'b11&&(jm==1'b1||cf))?1'b0:1'b1;wire[3:0]np;assign np=(lp==1'b0)?al:pc+1;always @(posedge cl or negedge rn) begin if(!rn)begin ra<=4'b0;rb<=4'b0;ro<=4'b0;cf<=1'b1;pc<=4'b0;end else begin ra<=#1(la==1'b
@asfdrwe
asfdrwe / distversion.patch
Created August 7, 2021 07:31
crossover-21.0.0 distversion.patch
diff -uNr sources.orig/wine/include/distversion.h sources/wine/include/distversion.h
--- sources.orig/wine/include/distversion.h 1970-01-01 09:00:00.000000000 +0900
+++ sources/wine/include/distversion.h 2021-02-07 17:03:44.000000000 +0900
@@ -0,0 +1,12 @@
+/* ---------------------------------------------------------------
+* distversion.c
+*
+* Copyright 2013, CodeWeavers, Inc.
+*
+* Information from DISTVERSION which needs to find
@asfdrwe
asfdrwe / bcrypt_coreaudio.patch
Created August 7, 2021 07:29
crossover-21.0.0 bcrypt and winecoreaudio patch
diff -uNr sources.orig/wine/dlls/bcrypt/macos.c sources/wine/dlls/bcrypt/macos.c
--- sources.orig/wine/dlls/bcrypt/macos.c 2021-08-07 10:03:32.000000000 +0900
+++ sources/wine/dlls/bcrypt/macos.c 2021-08-07 10:03:13.000000000 +0900
@@ -51,7 +51,9 @@
CCCryptorRef ref_encrypt;
CCCryptorRef ref_decrypt;
};
+#if 0
C_ASSERT( sizeof(struct key_data) <= sizeof(((struct key *)0)->private) );
+#endif
@asfdrwe
asfdrwe / Autolykos2_AMD_Miner-m1.patch
Created June 10, 2021 10:00
M1 Mac patch for Autolykos2_AMD_Miner
diff -uNr Autolykos2_AMD_Miner.orig/OCLdefs.h Autolykos2_AMD_Miner/OCLdefs.h
--- Autolykos2_AMD_Miner.orig/OCLdefs.h 2021-06-08 14:30:24.000000000 +0900
+++ Autolykos2_AMD_Miner/OCLdefs.h 2021-06-07 16:27:47.000000000 +0900
@@ -10,7 +10,7 @@
typedef long long int64_t;
#else
#ifndef __OPENCL_VERSION__
-#include <CL/cl.h>
+#include <OpenCL/cl.h>
#endif
@asfdrwe
asfdrwe / ethminer-m1.patch
Created May 13, 2021 10:38
ethminer-m1 boost url patch
diff -uNr ethminer-m1/cmake/Hunter/config.cmake ethminer-m1.new/cmake/Hunter/config.cmake
--- ethminer-m1/cmake/Hunter/config.cmake 2021-05-13 18:39:14.000000000 +0900
+++ ethminer-m1.new/cmake/Hunter/config.cmake 2021-05-13 19:13:58.000000000 +0900
@@ -1,8 +1,8 @@
hunter_config(CURL VERSION ${HUNTER_CURL_VERSION} CMAKE_ARGS HTTP_ONLY=ON CMAKE_USE_OPENSSL=OFF CMAKE_USE_LIBSSH2=OFF CURL_CA_PATH=none)
hunter_config(
Boost
- URL "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz"
- SHA1 "68be4a43b73c66370c8d3fd94723b3913217ce1b"
+ URL "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2"
@asfdrwe
asfdrwe / xmrig-kawpow-m1.patch
Created May 10, 2021 12:17
xmrig kawpow patch for M1 mac
diff -uNr xmrig/src/backend/opencl/OclConfig.cpp xmrig-m1/src/backend/opencl/OclConfig.cpp
--- xmrig/src/backend/opencl/OclConfig.cpp 2021-05-10 13:14:50.000000000 +0900
+++ xmrig-m1/src/backend/opencl/OclConfig.cpp 2021-05-10 13:15:09.000000000 +0900
@@ -40,12 +40,11 @@
static const char *kEnabled = "enabled";
static const char *kLoader = "loader";
-#ifndef XMRIG_OS_APPLE
static const char *kAMD = "AMD";
static const char *kINTEL = "INTEL";
@asfdrwe
asfdrwe / kawpowminer-m1.patch
Created May 3, 2021 08:17
M1 Mac patch for kawpowminer
diff -uNr kawpowminer/CMakeLists.txt kawpowminer-m1/CMakeLists.txt
--- kawpowminer/CMakeLists.txt 2021-05-03 16:32:38.000000000 +0900
+++ kawpowminer-m1/CMakeLists.txt 2021-05-03 14:52:37.000000000 +0900
@@ -14,8 +14,8 @@
set(HUNTER_CONFIGURATION_TYPES Release CACHE STRING "Build type of Hunter packages")
set(HUNTER_JOBS_NUMBER 6 CACHE STRING "Number of parallel builds used by Hunter")
HunterGate(
- URL "https://github.com/ruslo/hunter/archive/v0.23.214.tar.gz"
- SHA1 "e14bc153a7f16d6a5eeec845fb0283c8fad8c358"
+ URL "https://github.com/cpp-pm/hunter/archive/v0.23.295.tar.gz"