Skip to content

Instantly share code, notes, and snippets.

View BalorPrice's full-sized avatar
💭
Working on a new game conversion

Howard BalorPrice

💭
Working on a new game conversion
View GitHub Profile
@BalorPrice
BalorPrice / bresline.asm
Created May 15, 2019 21:33
Bresenham line drawing example
; BRESENHAM LINE DRAWING
; This assumes MODE 4 (SAM coupé) with screen in 0-24575.
;-------------------------------------------
line.plotHLC:
; Plot a point at (L,H) with colour C (0-15 only)
ex af,af'
push bc
push hl
; Example of rotation in Mode 4 for the SAM Coupé
inc_d: equ &14
inc_e: equ &1c
dec_d: equ &15
dec_e: equ &1d
;----------------------------------------------
gfx.print_rotatedHLDEBCA:
; Print bitmap rotated.
@BalorPrice
BalorPrice / thrust_maths_test.asm
Last active July 2, 2017 11:53
Rotational coords test
; MATHS ROUTINES
;--------------------------------------------
math.multDEBC:
; Input: DE = Multiplier, BC = Multiplicand
; Output: DE:HL = Product
; By Baze of 3SC. http://map.grauw.nl/sources/external/z80bits.html
ld hl,0
sla e
rl d
@BalorPrice
BalorPrice / SID test 3 28 May 2017.asm
Last active May 29, 2017 12:59
SAM coupé conversion of One-Page BASIC SID Benchmark in Plogue R&D
; +++++++++++++++++++++
; SID TEST 3: 28-May-17
; +++++++++++++++++++++
; Conversion of one-page basic SID benchmark by Plogue R&D
; http://ploguechipsounds.blogspot.co.uk/2010/05/one-page-basic-sid-benchmark.html
; Compiled with PYZ80
dump 1,0
autoexec
@BalorPrice
BalorPrice / SID test 2 20170524.asm
Last active May 29, 2017 09:10
SAM coupé conversion of SID test in C64 user manual
; +++++++++++++++++++++
; SID TEST 2: 24-May-17
; +++++++++++++++++++++
; Straight conversion of the C64 user manual example of playing a single-channel tune.
; Original program from http://www.lemon64.com/manual/manual/8_1.html
; Compiled with PYZ80
dump 1,0
autoexec
@BalorPrice
BalorPrice / simple_scroll.asm
Last active March 13, 2023 22:55
Simple ZX Spectrum scroller - amended from John Metcalf's 69-byte scroller
org 32768
init_scroll:
ld hl,message-1 ; set to refresh char on first call
ld (scroll_pos),hl
ld hl,pix_count ; variable to check if new character needed
ld (hl),1
ret
update_scroll: