Skip to content

Instantly share code, notes, and snippets.

View neuro-sys's full-sized avatar
💭
💾

Fırat Salgür neuro-sys

💭
💾
View GitHub Profile
@neuro-sys
neuro-sys / split-ex1.asm
Last active May 4, 2020 22:53
CPC split screen. Example demonstrates displaying the top 4 character rows starting from 0xc000, and the rest 0x8000
org &4000
run &4000
jp start
vsync
ld b, &f5
in a, (c)
rra
jr nc, vsync
in a, (c)
(defun hour-min-to-time (h m) (seconds-to-time (+ (* h 360) (* 60 m))))
(format-time-string "%H:%M" (time-add (hour-min-to-time 11 15) (hour-min-to-time 3 30)))
! Xft ----------------
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.dpi: 141
Xft.rgba: rgb
(in-package :stumpwm)
(set-font "-*-pxplus ibm vga8-*-*-*-*-17-*-*-*-*-*-*-*")
(load-module "battery-portable")
(load-module "wifi")
(load-module "net")
(load-module "cpu")
(setf *window-format* "%m%n%s%c")
(setf *screen-mode-line-format* (list "[^B%n^b] %W^>[%C] [%I] [%l] [%B] [%d]"))
(setf *time-modeline-string* "%a %b %e %H:%M")
(setf *mode-line-timeout* 2)
org #8000
jp start
input dw 1234 ; 16 bit number as input
; IN HL 16-bit unsigned
; D 8-bit unsigned
; OUT HL is HL / D
; A remainder
; Corrupts B
@neuro-sys
neuro-sys / 20200309.asm
Last active April 11, 2020 17:31
[2020-03-09] Challenge #383 [Easy] Necklace matching
;; [2020-03-09] Challenge #383 [Easy] Necklace matching
;;
;; Imagine a necklace with lettered beads that can slide along the
;; string. Here's an example image. In this example, you could take
;; the N off NICOLE and slide it around to the other end to make
;; ICOLEN. Do it again to get COLENI, and so on. For the purpose of
;; today's challenge, we'll say that the strings "nicole", "icolen",
;; and "coleni" describe the same necklace.
;;
;; Generally, two strings describe the same necklace if you can remove
xrdb -merge ~/.Xresources
xset r rate 200 60
xset +dpms
xset dpms 0 0 300
setxkbmap -option ctrl:nocaps
eval $(ssh-agent)
autocutsel -selection CLIPBOARD -fork &
dropbox &
xautolock -time 5 -locker "i3lock -c 43678a" &
@neuro-sys
neuro-sys / dhclient.conf
Created March 16, 2020 17:17
Prevent dhclient from updating resolv.conf
supersede domain-name "";
supersede domain-search "";
supersede search "";
do-forward-updates false;
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
;-----------------------------------------------------------------------------+
; Notes |
;-----------------------------------------------------------------------------+
; - Changing R12/R13 takes affect only when C4=C9=0, but should be set
; when C4>0 for compatibility reasons.
; - Changing R4 takes effect as long as C4 > R4' (new value).
; - Vsync starts when C4=C7
;-----------------------------------------------------------------------------+
;-----------------------------------------------------------------------------+
@neuro-sys
neuro-sys / pic16f690-pwm-star-wars.asm
Last active July 1, 2020 18:31
Wrote this mess when I was learning assembly with PIC for the first time back about 10 years ago.
#INCLUDE p16f690.inc
PROCESSOR P16F690
__CONFIG _INTRC_OSC_NOCLKOUT&_FCMEN_ON&_IESO_ON&_BOR_ON&_CPD_OFF&_CP_OFF&_MCLRE_OFF&_PWRTE_OFF&_WDT_OFF
ERRORLEVEL -302 ; SUPRESS BANK WARNING.
RADIX DEC
CBLOCK 0x20 ; RAM AREA
PULSE_TEMP ; PULSE FREQUENCY ALTERNATING FLAG