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 / z80_for_loop.md
Last active July 13, 2024 21:52
How to Write a For-Loop in Z80 Assembly

Write a For-Loop in Z80 Assembly

Note, this is intended for a beginner (as I was at the time when I wrote this) who thinks in terms of high level languages.

Firstly, it's best to type down what exactly we'd like to write in a higher level language:

int i;

for ( i = 0 ; i < 10 ; i++ ) {
; Transition effect 1
nolist
org #7000
jp start
fc ds 1 ; frame count
y1 ds 2 ; y pos counter
y2 ds 2 ; upper bound position
y3 ds 2 ; lower bound
;-----------------------------------------------------------------------------+
; 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 / amstrad_cpc.md
Last active July 4, 2024 10:23
Amstrad CPC 464/6128 Programming Resources

Amstrad CPC 464/6128 Programming Resources

A collection of information gathered from various resources into a single document to be able to program for Amstrad CPC 464/6128 machines.

Hardware

CPC has the following components on the mainboard:

@neuro-sys
neuro-sys / cpc_screen.asm
Last active July 4, 2024 10:22
Amstrad CPC image loader
#include <stdio.h>
#include <assert.h>
/*
# Mini CPC documentation
CPC has the following chips that are controlled via z80's in and out instructions
- Gate Array
- CRTC
- 8255
I/O Ports are documented here
@neuro-sys
neuro-sys / cpc_firmware.inc
Created January 20, 2016 12:54
Amstrad CPC firmware definitions
kl_choke_off equ &bcc8
kl_rom_walk equ &bccb
kl_init_back equ &bcce
kl_log_ext equ &bcd1
kl_find_command equ &bcd4
kl_new_framefly equ &bcd7
kl_add_framefly equ &bcda
kl_del_framefly equ &bcdd
kl_new_fast_ticker equ &bce0
kl_add_fast_ticker equ &bce3
@neuro-sys
neuro-sys / common.inc
Last active July 4, 2024 10:20
Amstrad CPC / Z80 / WinAPE common macro definitions
macro saveregs oldsp, stack
push af
push bc
push de
push hl
push ix
push iy
ld (oldsp), sp
ld sp, stack
mend
@neuro-sys
neuro-sys / Dockerfile
Last active May 17, 2024 06:47
Dockerfile for headless-gl. You also need to run Docker container in "privileged" mode, assign X11 auth volume on the container, and possibly give Xauth access for call from outside.
# Build stage
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu20.04 as builder
# Install node 14.0
RUN apt-get update -y && \
apt-get install -y curl gnupg ca-certificates && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# See: https://github.com/stackgl/headless-gl#ubuntudebian
@neuro-sys
neuro-sys / dnd.txt
Created January 24, 2015 15:25
dnd.txt
Folder PATH listing
Volume serial number is 00000065 6A5C:3BBA
C:.
| dnd.txt
|
+---1st Edition
| +---Accessories
| | tsr09293 RPGA Magic Encyclopedia Vol 1.pdf
| | tsr09334 - AD&D DL_-_Wild_Elves.pdf
| |