Macros and Aliases

Minicube64 has some useful aliases and macros that can be used as shorthand for common code tasks.

These are included in each ROM with include "64cube.inc" at the top.

These aliases and macros are optional but good practise to include them.

Available Aliases

These are aliases to the memory addresses of control registers.

Graphics and Input

VIDEO = $100
COLORS = $101
INPUT = $102

Audio

AUDIO = $104
AUDIO_REGS = $110
AUDIO_VOLUME = $111
AUDIO_CHANNEL1 = $112
AUDIO_CHANNEL2 = $112+4
AUDIO_CHANNEL3 = $112+8
AUDIO_CHANNEL3 = $112+12

Interrrupt Vectors

NMI_IRQ = $10c
VBLANK_IRQ = $10e

VBLANKInterrupt vector is0x010eunlike0xfffeon other 6502 systems.

Current Macros

_setb value,dest

Sets a byte value to a destination 8 bit memory address.

	lda #value
	sta dest 

Sets a word value to a destination 16 bit memory address.

_setw value,dest

	lda #<value
	sta dest 
	lda #>value 
	sta dest+1

_movw value,dest

	lda value
	sta dest 
	lda value+1 
	sta dest+1

_addw source,addition,dest

	clc 
	lda source 
	adc addition
	sta dest 
	lda source+1
	adc addition+1
	sta dest+1

_addwb source,addition,dest

	clc 
	lda source 
	adc addition
	sta dest 
	lda source+1
	adc #0
	sta dest+1

_addwi source,addition,dest

	clc 
	lda source 
	adc #<addition
	sta dest 
	lda source+1
	adc #>addition
	sta dest+1

Last updated